From 2ded8676f4e46784dfb3ee4b4f9261695f14d783 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 29 Dec 2024 13:13:44 +0100 Subject: [PATCH] Push to the remote registry only on the main branch --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 549df8c..1fed3f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: with: context: . target: deps - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:deps cache-to: type=inline @@ -40,7 +40,7 @@ jobs: with: context: . target: builder - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:builder cache-to: type=inline @@ -49,7 +49,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.ref == 'refs/heads/main' }} tags: ${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest cache-from: type=registry,ref=${{ secrets.PRIVATE_REGISTRY_HOST }}/${{ env.GITHUB_REPOSITORY }}:latest cache-to: type=inline \ No newline at end of file