Merge pull request #193 from codefresh-io/CR-30835 #161
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: Chart Publish | |
| on: | |
| push: | |
| branches: | |
| - argo-workflows | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish: | |
| if: github.repository == 'codefresh-io/argo-helm' | |
| permissions: | |
| contents: write # for helm/chart-releaser-action to push chart release and create a release | |
| packages: write # to push OCI chart package to GitHub Registry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Helm | |
| uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0 | |
| with: | |
| version: v3.10.1 # Also update in lint-and-test.yaml | |
| - name: Add dependency chart repos | |
| run: | | |
| helm repo add dandydeveloper https://dandydeveloper.github.io/charts/ | |
| - name: Configure Git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Package chart | |
| run: | | |
| rm -rf .cr-release-packages | |
| mkdir .cr-release-packages | |
| helm package charts/argo-workflows -u -d .cr-release-packages/ | |
| - name: Run chart-releaser | |
| uses: helm/chart-releaser-action@cae68fefc6b5f367a0275617c9f83181ba54714f # v1.7.0 | |
| with: | |
| config: "./.github/configs/cr.yaml" | |
| skip_packaging: true | |
| env: | |
| CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
| - name: Login to GHCR | |
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push chart to GHCR | |
| run: | | |
| shopt -s nullglob | |
| for pkg in .cr-release-packages/*.tgz; do | |
| if [ -z "${pkg:-}" ]; then | |
| break | |
| fi | |
| helm push "${pkg}" oci://ghcr.io/${{ github.repository }} | |
| done |