Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: publish helm chart to resolve #106 #110

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/package-helm-chart.yaml
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
Loading