From b4fafe4b8e7c8d6f376661a21156d7977acc0130 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sun, 30 Jun 2024 22:55:26 +0200 Subject: [PATCH] ci(container): improve workflow --- .github/workflows/container.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 533e539..5bece6c 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -2,11 +2,19 @@ name: Build container on: push: - pull_request: - # Build regularly in order to have up to date base images in the edge image + branches: + - main + tags: + - v* + workflow_dispatch: + # 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 @@ -30,16 +38,15 @@ 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 username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/build-push-action@v5 + - uses: docker/build-push-action@v6 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 }}