Merge pull request #451 from albinati/fix/appliance-test-frozen-clock #223
This file contains hidden or 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: Build and publish Docker image | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| workflow_dispatch: | |
| # Serialise builds per ref. Without this, two ``main`` commits landing | |
| # back-to-back kick off two parallel builds; whichever finishes second | |
| # wins the mutable ``:main`` tag, regardless of git commit order. We | |
| # observed this on 2026-05-06 (issue #268): the older commit's build | |
| # completed slightly later and overwrote the ``:main`` tag, sending | |
| # stale code to prod on the next ``docker compose pull``. | |
| # | |
| # ``cancel-in-progress: false`` keeps the older build running so we | |
| # still get a ``:<sha>`` tag for it (useful for rollback / audit); | |
| # the newer build queues up and pushes its tag last → ``:main`` | |
| # always reflects the latest commit. | |
| concurrency: | |
| group: docker-publish-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=sha,format=long | |
| type=ref,event=branch | |
| type=ref,event=tag | |
| - name: Build and push | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| GIT_SHA=${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |