Skip to content

Commit

Permalink
fix: only run deploy steps on main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SchutteJan committed Aug 20, 2024
1 parent 8dc84a3 commit dcb4158
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ jobs:
- name: Build the image
run: docker build . --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}"
- name: Log in to registry
if: github.ref == 'refs/heads/main'
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
if: github.ref == 'refs/heads/main'
run: |
IMAGE_ID=ghcr.io/$REPO_OWNER/$IMAGE_NAME
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
Expand Down

0 comments on commit dcb4158

Please sign in to comment.