Skip to content

Commit

Permalink
Conditionally only attempt to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Jan 6, 2025
1 parent da3e757 commit 5e0140f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish image
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_RECORD_UPLOAD: false
Expand All @@ -58,7 +57,8 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
push: true
push: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}


- name: install helm
uses: Azure/setup-helm@v3
Expand All @@ -67,10 +67,12 @@ jobs:
id: install

- name: login to gcr using helm
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io/${{ github.repository }} --username ${{ github.repository_owner }} --password-stdin
- name: package chart and push it
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
run: |
helm dependencies update helm/numtracker
helm package helm/numtracker --version ${{ steps.meta.outputs.version }} --app-version ${{ steps.meta.outputs.version }} -d /tmp/
Expand Down

0 comments on commit 5e0140f

Please sign in to comment.