From 65589d11d1fae45cc51e55ea16953c4eb30a0f35 Mon Sep 17 00:00:00 2001 From: Gabriel Gerlero Date: Mon, 1 Jan 2024 18:44:48 -0300 Subject: [PATCH] Update Docker workflows --- .github/workflows/{docker.yml => Docker.yml} | 21 ++++++++----------- ...scription.yml => DockerHubDescription.yml} | 3 +-- 2 files changed, 10 insertions(+), 14 deletions(-) rename .github/workflows/{docker.yml => Docker.yml} (76%) rename .github/workflows/{dockerhub-description.yml => DockerHubDescription.yml} (93%) diff --git a/.github/workflows/docker.yml b/.github/workflows/Docker.yml similarity index 76% rename from .github/workflows/docker.yml rename to .github/workflows/Docker.yml index 98ab6031..10053232 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/Docker.yml @@ -1,35 +1,32 @@ name: Docker - on: push: branches: - main - tags: - - '*' + tags: ['*'] pull_request: - branches: - - main workflow_dispatch: inputs: - arm64: - description: Build multi-platform image including arm64 + multi-platform: + description: Build multi-platform image (amd64 and arm64) type: boolean required: false default: false - +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} env: IMAGES: | ${{ vars.DOCKERHUB_REPOSITORY || github.repository }} - jobs: docker: runs-on: ubuntu-latest steps: - name: Set up QEMU - if: inputs.arm64 uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - if: inputs.arm64 uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta @@ -52,7 +49,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - platforms: ${{ (github.event_name == 'push' || inputs.arm64) && 'linux/amd64,linux/arm64' || '' }} + platforms: ${{ (inputs.multi-platform || github.event_name == 'push') && 'linux/amd64,linux/arm64' || '' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | # Julia's Pkg expects a Git repository diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/DockerHubDescription.yml similarity index 93% rename from .github/workflows/dockerhub-description.yml rename to .github/workflows/DockerHubDescription.yml index f1ba1e2f..30588f5e 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/DockerHubDescription.yml @@ -5,9 +5,8 @@ on: - main paths: - README.md - - .github/workflows/dockerhub-description.yml + - .github/workflows/DockerHubDescription.yml workflow_dispatch: - jobs: dockerhub-description: if: vars.DOCKERHUB_REPOSITORY