From 2c26341d37f36e5431ad6c4eb0ee690bf0cfe151 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Wed, 8 Jun 2022 11:59:11 +0100 Subject: Fix build - should_run not properly set (#40) --- .github/workflows/docker.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to '.github/workflows/docker.yml') diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c07cd2a..775706e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,7 +21,6 @@ jobs: - name: Check whether there are any commits since this run was last triggered and push them and/or set the output id: should_run - if: ${{ (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[main]')) }} run: | git config user.name github-actions git config user.email github-actions@github.com @@ -63,6 +62,7 @@ jobs: - name: Docker meta id: meta + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} uses: docker/metadata-action@v4 with: # list of Docker images to use as base name for tags @@ -76,12 +76,15 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} - name: Login to GitHub Container Registry uses: docker/login-action@v2 + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -89,12 +92,13 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2 + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push - if: ${{ (github.event_name == 'workflow_dispatch' && contains(github.event.inputs.message, '[main]')) }} + if: ${{ (steps.should_run.outputs.should_run != 'false') && (github.event_name != 'workflow_dispatch' || (github.event_name == 'workflow_dispatch' && (contains(github.event.inputs.message, '[main]'))) )}} uses: docker/build-push-action@v3 with: context: . -- cgit v1.2.3-54-g00ecf