forked from Azure-Samples/aks-store-demo
-
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.
ci: publish helm chart to resolve Azure-Samples#106
- Loading branch information
Showing
1 changed file
with
47 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,47 @@ | ||
name: package-helm-chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'charts/**' | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
jobs: | ||
package-helm-chart: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set environment variables | ||
id: set-variables | ||
run: | | ||
echo "REPOSITORY=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | ||
echo "VERSION=$(yq -r .version ./charts/aks-store-demo/Chart.yaml)" >> "$GITHUB_OUTPUT" | ||
- name: Env variable output | ||
id: test-variables | ||
run: | | ||
echo ${{ steps.set-variables.outputs.REPOSITORY }} | ||
echo ${{ steps.set-variables.outputs.VERSION }} | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ github.token }} | ||
|
||
- name: Package and push helm chart | ||
run: | | ||
helm package ./charts/aks-store-demo --version ${{ steps.set-variables.outputs.VERSION }} | ||
helm push ./aks-store-demo-chart-${{ steps.set-variables.outputs.VERSION }}.tgz oci://${{ steps.set-variables.outputs.REPOSITORY }}/charts |