Merge pull request #23 from whylabs/dev/aberg/whylogs-chart-#86b020jvv #78
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
name: Helm Chart Workflow | |
on: | |
push: | |
branches: | |
- mainline | |
pull_request: | |
branches: | |
- mainline | |
jobs: | |
Helm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.14.0 | |
- name: Package All Helm Charts | |
if: github.event_name == 'push' | |
working-directory: ${{ github.workspace }}/charts | |
run: | | |
for dir in */ ; do | |
if [ -f "$dir/Chart.yaml" ]; then | |
helm package "$dir" | |
fi | |
done | |
shell: bash | |
- name: Login to GHCR | |
if: github.event_name == 'push' | |
run: | | |
docker login ghcr.io \ | |
-u ${{ github.repository_owner }} \ | |
--password-stdin < <(echo "${{ secrets.GITHUB_TOKEN }}") | |
- name: Publish Helm Charts to GHCR | |
if: github.event_name == 'push' | |
working-directory: ${{ github.workspace }}/charts | |
run: | | |
for chart in *.tgz ; do | |
chart_name=$(basename "$chart" .tgz) | |
chart_version=$(echo "$chart_name" | sed 's/.*-//') | |
ghcr_chart="ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/${chart_name}:${chart_version}" | |
helm push "$chart" oci://ghcr.io/${{ github.repository_owner }} | |
done | |
shell: bash | |