From c4498a09b423b445d87f778c660f948589c0f0da Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Fri, 17 Apr 2026 10:53:58 +0000 Subject: [PATCH 1/4] ci --- .github/workflows/ghcr.yml | 61 -------------------------------------- .github/workflows/test.yml | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/ghcr.yml diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml deleted file mode 100644 index 1a935ac22..000000000 --- a/.github/workflows/ghcr.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: GHCR - -on: - workflow_dispatch: - push: - branches: [master] - tags: ["v*.*.*"] - -env: - REGISTRY: ghcr.io - -jobs: - build-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - - strategy: - matrix: - image: [nginx, service] - - steps: - - name: Checkout repository - uses: actions/checkout@v5 - with: - fetch-depth: 0 - fetch-tags: true - submodules: recursive - - - name: Log into registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Show Docker Context - run: ./test/check-docker-context.sh --report - - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/central-${{ matrix.image }} - - - name: Set up QEMU emulator for multi-arch images - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build and push ${{ matrix.image }} Docker image - uses: docker/build-push-action@v5 - with: - file: ${{ matrix.image }}.dockerfile - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - platforms: 'linux/amd64,linux/arm64' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e91da08db..6cc083e0a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,7 @@ name: Test on: push: pull_request: + workflow_dispatch: jobs: test-misc: # quick, simple checks @@ -83,3 +84,59 @@ jobs: - run: ./test/test-images.sh - if: always() run: docker compose logs + build-push-image: + if: | + github.event_name == 'workflow_dispatch' || ( + github.event_name == 'push' && ( + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/tags/v20') + ) + ) + needs: + - test-images + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + image: [nginx, service] + env: + REGISTRY: ghcr.io + steps: + - name: Checkout repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 + fetch-tags: true + submodules: recursive + - name: Log into registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Show Docker Context + run: ./test/check-docker-context.sh --report + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/central-${{ matrix.image }} + + - name: Set up QEMU emulator for multi-arch images + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push ${{ matrix.image }} Docker image + uses: docker/build-push-action@v5 + with: + file: ${{ matrix.image }}.dockerfile + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: 'linux/amd64,linux/arm64' From 0b69bcd1bbafa1c73c116296b924f0e15489554b Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Fri, 17 Apr 2026 10:54:27 +0000 Subject: [PATCH 2/4] ci: only publish containers if tests passed Closes #1819 --- .github/workflows/{test.yml => main.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{test.yml => main.yml} (99%) diff --git a/.github/workflows/test.yml b/.github/workflows/main.yml similarity index 99% rename from .github/workflows/test.yml rename to .github/workflows/main.yml index 6cc083e0a..cf746a7e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Test +name: Test, Build, Publish on: push: From 87b481006280ffdbddf40c032a46de2b97af40ae Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Mon, 20 Apr 2026 16:42:06 +0000 Subject: [PATCH 3/4] update action versions --- .github/workflows/main.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6296c5a2..1d87ed6cf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -113,7 +113,7 @@ jobs: fetch-tags: true submodules: recursive - name: Log into registry ${{ env.REGISTRY }} - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -123,18 +123,18 @@ jobs: - name: Extract Docker metadata id: meta - uses: docker/metadata-action@v5 + uses: docker/metadata-action@v6 with: images: ${{ env.REGISTRY }}/${{ github.repository_owner }}/central-${{ matrix.image }} - name: Set up QEMU emulator for multi-arch images - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Build and push ${{ matrix.image }} Docker image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v7 with: file: ${{ matrix.image }}.dockerfile context: . From 72066ec3e1935ec6143dcce3eb5ffbdc6a99928b Mon Sep 17 00:00:00 2001 From: alxndrsn Date: Wed, 22 Apr 2026 10:25:00 +0000 Subject: [PATCH 4/4] fix publish conditionals --- .github/workflows/main.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1d87ed6cf..d15cef75b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,12 @@ on: push: pull_request: workflow_dispatch: + inputs: + publish_image: + description: 'Publish image to registry?' + required: true + type: boolean + default: false jobs: test-misc: # quick, simple checks @@ -88,12 +94,11 @@ jobs: run: docker compose logs build-push-image: if: | - github.event_name == 'workflow_dispatch' || ( - github.event_name == 'push' && ( - github.ref == 'refs/heads/master' || - startsWith(github.ref, 'refs/tags/v20') - ) - ) + (github.event_name == 'workflow_dispatch' && inputs.publish_image == true) || + (github.event_name != 'workflow_dispatch' && ( + github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/tags/v') + )) needs: - test-images runs-on: ubuntu-latest