Skip to content

Commit 1c6aca6

Browse files
authored
ci: should now be able to publish helm from release workflow (#2212)
* ci: should now be able to publish helm from release workflow * ci: will now use publish token for the actions
1 parent f87f226 commit 1c6aca6

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/helm-publish.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ on:
44
release:
55
types:
66
- published
7+
workflow_call:
8+
inputs:
9+
tag_name:
10+
required: true
11+
type: string
12+
secrets:
13+
HELM_PUBLISH_TOKEN:
14+
required: true
715

816
jobs:
917
publish:
1018
name: Package and publish charts
1119
runs-on: ubuntu-latest
1220
steps:
1321
- uses: actions/checkout@v5
22+
with:
23+
ref: ${{ inputs.tag_name || github.event.release.tag_name }}
1424

1525
- name: Install Helm
1626
uses: azure/setup-helm@v4
@@ -20,7 +30,7 @@ jobs:
2030

2131
- name: Update and package all charts
2232
run: |
23-
TAG="${{ github.event.release.tag_name }}"
33+
TAG="${{ inputs.tag_name || github.event.release.tag_name }}"
2434
VERSION="${TAG#v}"
2535
APP_VERSION="$TAG"
2636
mkdir -p /tmp/helm-package
@@ -43,7 +53,7 @@ jobs:
4353
cp /tmp/helm-package/*.tgz charts-branch/
4454
cd charts-branch
4555
helm repo index . \
46-
--url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
56+
--url https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name || 'testnet' }}
4757
4858
- name: Commit and push to charts branch
4959
run: |

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ jobs:
118118
env:
119119
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120120

121+
helm-publish:
122+
name: Publish Helm charts
123+
needs: release
124+
if: needs.release.outputs.new_release_published == 'true'
125+
uses: ./.github/workflows/helm-publish.yml
126+
with:
127+
tag_name: v${{ needs.release.outputs.new_release_version }}
128+
secrets:
129+
HELM_PUBLISH_TOKEN: ${{ secrets.HELM_PUBLISH_TOKEN }}
130+
121131
publish:
122132
name: Publish Docker images
123133
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)