diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index a6a24c1..9413443 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -2,12 +2,19 @@ name: Build container on: push: - pull_request: + branches: + - main + tags: + - v* workflow_dispatch: - # Build regularly in order to have up to date base images in the edge image + # Build regularly in order to have up to date base image in the edge image schedule: - cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + permissions: contents: read packages: write @@ -31,7 +38,6 @@ jobs: - uses: docker/setup-buildx-action@v3 - name: Login to GHCR - if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') uses: docker/login-action@v3 with: registry: ghcr.io @@ -41,6 +47,6 @@ jobs: - uses: docker/build-push-action@v5 with: platforms: linux/amd64, linux/arm64/v8 - push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}