From 23f091d7fafe70b7ad2eec2b85621383fe766335 Mon Sep 17 00:00:00 2001 From: Callum Tait <15716903+toast-gear@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:03:36 +0100 Subject: [PATCH] ci: don't login on a pr (#1554) * ci: don't login on a pr Co-authored-by: toast-gear --- .github/actions/setup-docker-environment/action.yaml | 2 ++ .github/workflows/runners.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml index d2e1955c..ace88fa0 100644 --- a/.github/actions/setup-docker-environment/action.yaml +++ b/.github/actions/setup-docker-environment/action.yaml @@ -37,12 +37,14 @@ runs: version: latest - name: Login to DockerHub + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: docker/login-action@v2 with: username: ${{ inputs.username }} password: ${{ inputs.password }} - name: Login to GitHub Container Registry + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'refs/heads/master' }} uses: docker/login-action@v2 with: registry: ghcr.io diff --git a/.github/workflows/runners.yaml b/.github/workflows/runners.yaml index 50e11d2d..26d49c0d 100644 --- a/.github/workflows/runners.yaml +++ b/.github/workflows/runners.yaml @@ -61,7 +61,7 @@ jobs: context: ./runner file: ./runner/${{ matrix.name }}.dockerfile platforms: linux/amd64,linux/arm64 - push: ${{ github.ref == 'master' && github.event.pull_request.merged == true }} + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} build-args: | RUNNER_VERSION=${{ env.RUNNER_VERSION }} DOCKER_VERSION=${{ env.DOCKER_VERSION }}