From 2e3e42837561eeb51f42a9a719bdfb79bb55502c Mon Sep 17 00:00:00 2001 From: Callum Tait <15716903+toast-gear@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:11:16 +0100 Subject: [PATCH 1/5] ci: don't login on a pr --- .github/actions/setup-docker-environment/action.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml index d2e1955c51..e4e850fd1c 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.ref == 'master' }} uses: docker/login-action@v2 with: username: ${{ inputs.username }} password: ${{ inputs.password }} - name: Login to GitHub Container Registry + if: ${{ github.ref == 'master' }} uses: docker/login-action@v2 with: registry: ghcr.io From 9f72e0ebe15c063c290edfa6fbc727394addf580 Mon Sep 17 00:00:00 2001 From: Callum Tait <15716903+toast-gear@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:17:54 +0100 Subject: [PATCH 2/5] ci: remove check for pr merge --- .github/workflows/runners.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/runners.yaml b/.github/workflows/runners.yaml index 50e11d2d48..e239df4644 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.ref == 'master' }} build-args: | RUNNER_VERSION=${{ env.RUNNER_VERSION }} DOCKER_VERSION=${{ env.DOCKER_VERSION }} From b59b7ae2f7201c8d0495e2de7a45dd89f7de1d90 Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 22 Jun 2022 15:33:41 +0100 Subject: [PATCH 3/5] ci: conditionals for all pipelines --- .github/actions/setup-docker-environment/action.yaml | 4 ++-- .github/workflows/runners.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml index e4e850fd1c..3eed63dc78 100644 --- a/.github/actions/setup-docker-environment/action.yaml +++ b/.github/actions/setup-docker-environment/action.yaml @@ -37,14 +37,14 @@ runs: version: latest - name: Login to DockerHub - if: ${{ github.ref == 'master' }} + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'master' }} uses: docker/login-action@v2 with: username: ${{ inputs.username }} password: ${{ inputs.password }} - name: Login to GitHub Container Registry - if: ${{ github.ref == 'master' }} + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'master' }} uses: docker/login-action@v2 with: registry: ghcr.io diff --git a/.github/workflows/runners.yaml b/.github/workflows/runners.yaml index e239df4644..131825a2ce 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' }} + push: ${{ github.event_name == 'push' && github.ref == 'master' }} build-args: | RUNNER_VERSION=${{ env.RUNNER_VERSION }} DOCKER_VERSION=${{ env.DOCKER_VERSION }} From 316ea2c6334e7cc5a54ea03c62eaec3b4e15dd50 Mon Sep 17 00:00:00 2001 From: Callum Tait <15716903+toast-gear@users.noreply.github.com> Date: Wed, 22 Jun 2022 15:48:32 +0100 Subject: [PATCH 4/5] ci: super duper minor whitespace fixes --- .github/actions/setup-docker-environment/action.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml index 3eed63dc78..1ded319482 100644 --- a/.github/actions/setup-docker-environment/action.yaml +++ b/.github/actions/setup-docker-environment/action.yaml @@ -37,14 +37,14 @@ runs: version: latest - name: Login to DockerHub - if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'master' }} + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == '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 == 'master' }} + if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'master' }} uses: docker/login-action@v2 with: registry: ghcr.io From bdd651d8a264f8a9a782c6d221a45ba9a22998ac Mon Sep 17 00:00:00 2001 From: toast-gear Date: Wed, 22 Jun 2022 15:55:01 +0100 Subject: [PATCH 5/5] ci: use full ref path --- .github/actions/setup-docker-environment/action.yaml | 4 ++-- .github/workflows/runners.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-docker-environment/action.yaml b/.github/actions/setup-docker-environment/action.yaml index 3eed63dc78..ab2cfd9248 100644 --- a/.github/actions/setup-docker-environment/action.yaml +++ b/.github/actions/setup-docker-environment/action.yaml @@ -37,14 +37,14 @@ runs: version: latest - name: Login to DockerHub - if: ${{ github.event_name == 'release' || github.event_name == 'push' && github.ref == 'master' }} + 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 == 'master' }} + 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 131825a2ce..26d49c0d81 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.event_name == 'push' && github.ref == 'master' }} + push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} build-args: | RUNNER_VERSION=${{ env.RUNNER_VERSION }} DOCKER_VERSION=${{ env.DOCKER_VERSION }}