From f6d93f2fdb0523483d4dc74ece81e4a11fc823b5 Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 6 Oct 2025 00:13:08 +0800 Subject: [PATCH] GitHub Actions: add workflow to build Docker images for CI --- .github/workflows/docker_builds.yml | 83 +++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .github/workflows/docker_builds.yml diff --git a/.github/workflows/docker_builds.yml b/.github/workflows/docker_builds.yml new file mode 100644 index 000000000..1c6beaa81 --- /dev/null +++ b/.github/workflows/docker_builds.yml @@ -0,0 +1,83 @@ +name: Docker test image builds + +on: + push: + branches: + - master + paths: + - 'docker/**' + workflow_dispatch: + +concurrency: + group: docker-builds + +env: + REGISTRY: ghcr.io + NAMESPACE: fish-ci + +jobs: + docker-build: + permissions: + contents: read + packages: write + attestations: write + id-token: write + + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + target: alpine + - os: ubuntu-latest + target: centos9 + - os: ubuntu-latest + target: fedora + - os: ubuntu-latest + target: focal-32bit + - os: ubuntu-24.04-arm + target: focal-arm64 + - os: ubuntu-latest + target: focal + - os: ubuntu-24.04-arm + target: jammy-armv7-32bit + - os: ubuntu-latest + target: jammy-asan + - os: ubuntu-latest + target: jammy-tsan + - os: ubuntu-latest + target: jammy + - os: ubuntu-latest + target: noble + - os: ubuntu-latest + target: opensuse-tumbleweed + runs-on: ${{ matrix.os }} + + steps: + - + name: Checkout + uses: actions/checkout@v5 + - + name: Login to Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.NAMESPACE }}/${{ matrix.target }} + flavor: | + latest=true + - + name: Build and push + uses: docker/build-push-action@v6 + with: + context: docker/context + push: true + file: docker/${{ matrix.target }}.Dockerfile + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}