Skip to content

Commit

Permalink
feat: package helm chart on push (#74)
Browse files Browse the repository at this point in the history
* feat: package helm chart on push

* fix: semver compatible chart version

* fix: typo
  • Loading branch information
niklastreml authored Jan 18, 2024
1 parent c4602b2 commit 9dc3eed
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Contiuous Integration
name: Continuous Integration

on:
push:
Expand Down Expand Up @@ -61,4 +61,35 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push snapshot container image
run: docker push ghcr.io/caas-team/sparrow:${{ steps.version.outputs.value }}
run: docker push ghcr.io/caas-team/sparrow:${{ steps.version.outputs.value }}
helm:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-tags: true

- name: Fetch tags explicitly
run: git fetch --tags

- name: Get App Version
id: appVersion
run: echo "value=commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Get Chart Version
id: chartVersion
# produces a tag like: 0.2.2-commit-asdf3
run: echo "value=$(git tag --sort=taggerdate | tail -1 | cut -c 2-)-commit-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT

- name: Registry login
run: helm registry login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}

- name: Helm lint
run: helm lint ./chart

- name: Helm package
run: helm package ./chart -d ./chart --version ${{ steps.chartVersion.outputs.value }} --app-version ${{ steps.appVersion.outputs.value }}

- name: Push helm package
run: helm push $(ls ./chart/*.tgz| head -1) oci://ghcr.io/${{ github.repository_owner }}/charts

0 comments on commit 9dc3eed

Please sign in to comment.