Automatically set version and commit ID as part of release workflow #2
Workflow file for this run
This file contains hidden or 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: Build and Push Container Images | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| paths: | |
| - '.github/**' | |
| - 'chart/**' | |
| jobs: | |
| helm: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Helm | |
| uses: azure/setup-helm@v3 | |
| - name: Set Helm appVersion based on current tag | |
| run: | | |
| sed -i -E 's/appVersion: (.+)$/appVersion: ${{ github.ref_name }}/' chart/Chart.yaml | |
| # https://helm.sh/docs/topics/registries/ | |
| - name: Package and Push Chart as OCI artifact | |
| run: | | |
| helm package ./chart | |
| helm push ./restic-k8s-*.tgz oci://ghcr.io/${{ github.repository }}/charts |