-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add action to package and publish chart
- Loading branch information
1 parent
b627094
commit 622d9a6
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Publish Helm Chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Helm | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: Package Helm Chart | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
helm package charts/langkit | ||
- name: Login to GHCR | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | \ | ||
docker login ghcr.io \ | ||
-u ${{ github.repository_owner }} \ | ||
--password-stdin | ||
- name: Publish Helm Chart | ||
working-directory: ${{ github.workspace }} | ||
run: | | ||
chart=$(find . -name '*.tgz' | sort -r | head -n 1) | ||
version=$(basename $chart | sed 's/\.tgz//') | ||
docker tag $chart \ | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/$version | ||
docker push \ | ||
ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/$version |