Skip to content

Commit

Permalink
Only pushing output image to ghcr if we push code to master
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickfuhrmann committed Jul 24, 2024
1 parent 0c81791 commit eac0a72
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Deploy

on:
push:
branches: [ "master" ]
branches: [ "mongodb-update-f2" ]
pull_request:
branches: [ "master" ]
branches: [ "mongodb-update-f2" ]


jobs:
Expand Down Expand Up @@ -34,10 +34,19 @@ jobs:
tags: type=sha,format=long,prefix= # adds :<sha> tag to outputs.tags

- name: Build and push
if: github.ref == 'refs/heads/master'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: true
tags: ${{ steps.meta.outputs.tags }}

- name: Build and push
if: github.ref != 'refs/heads/master'
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64/v8
push: false
tags: ${{ steps.meta.outputs.tags }}

0 comments on commit eac0a72

Please sign in to comment.