CI #66
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
# Run at 04:10 on Sunday | |
- cron: "10 4 * * 0" | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: | |
- amd64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lint Containerfile | |
uses: hadolint/hadolint-action@master | |
with: | |
dockerfile: "Containerfile" | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: lint | |
strategy: | |
matrix: | |
arch: | |
- amd64 | |
- arm64 | |
steps: | |
- name: Install the fish shell | |
uses: fish-actions/install-fish@v1.1.0 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Configure Podman and Buildah to use FUSE | |
run: | | |
sudo apt-get install fuse-overlayfs | |
mkdir -vp ~/.config/containers | |
printf '[storage]\ndriver="overlay"\n\n[storage.options]\nmount_program="/usr/bin/fuse-overlayfs"\n' > ~/.config/containers/storage.conf | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Build the image with Podman | |
run: podman build . --arch ${{ matrix.arch }} --tag caddy-ovh-${{ matrix.arch }} | |
- name: Export the image | |
run: podman image save --format oci-archive -o caddy-ovh-${{ matrix.arch }}.tar localhost/caddy-ovh-${{ matrix.arch }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: caddy-ovh-${{ matrix.arch }} | |
path: caddy-ovh-${{ matrix.arch }}.tar | |
# test: | |
# name: Test | |
# runs-on: ubuntu-latest | |
# needs: build | |
# strategy: | |
# matrix: | |
# arch: | |
# - amd64 | |
# - arm64 | |
# steps: | |
# - name: Install the fish shell | |
# uses: fish-actions/install-fish@v1.1.0 | |
# - name: Set up QEMU | |
# uses: docker/setup-qemu-action@v3 | |
# - name: Check out the repository | |
# uses: actions/checkout@v4 | |
# - uses: actions/download-artifact@v4 | |
# with: | |
# name: caddy-ovh-${{ matrix.arch }} | |
# - name: Load the image | |
# run: podman image load -i caddy-ovh-${{ matrix.arch }}.tar | |
# - name: Test the container | |
# run: ./test.fish --name caddy-ovh-${{ matrix.arch }} | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Create a manifest | |
run: buildah manifest create caddy-ovh:latest | |
# aarch64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: caddy-ovh-arm64 | |
- name: Load the aarch64 image | |
run: podman image load -i caddy-ovh-arm64.tar | |
- name: Add the aarch64 image to the manifest | |
run: buildah manifest add caddy-ovh:latest localhost/caddy-ovh-arm64 | |
# x86_64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: caddy-ovh-amd64 | |
- name: Load the x86_64 image | |
run: podman image load -i caddy-ovh-amd64.tar | |
- name: Add the x86_64 image to the manifest | |
run: buildah manifest add caddy-ovh:latest localhost/caddy-ovh-amd64 | |
- name: Push latest manifest and images to quay.io | |
run: buildah manifest push --rm --all --creds jwillikers+publisher:${{ secrets.REGISTRY_PASSWORD }} caddy-ovh:latest docker://quay.io/jwillikers/caddy-ovh |