Merge pull request #9 from comet-ml/CRThaze/test #21
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: Release Helm Chart | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - charts/s3proxy/** | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: main | |
| persist-credentials: false | |
| - name: Save HEAD SHA before helm-docs | |
| id: save-sha | |
| run: | | |
| echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Render helm docs inside the README.md and push changes back to PR branch | |
| uses: losisin/helm-docs-github-action@v1 | |
| with: | |
| output-file: ../../README.md | |
| template-files: README.md.gotmpl | |
| git-push: false | |
| - name: Check for README changes | |
| id: check-changes | |
| run: | | |
| if git diff --quiet ${{ steps.save-sha.outputs.sha }} -- README.md | |
| then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push | |
| if: steps.check-changes.outputs.has_changes == 'true' | |
| run: | | |
| git config --global user.name "Comet Actions" | |
| git config --global user.email "[email protected]" | |
| # stage any file changes to be committed | |
| git add README.md | |
| # make commit with staged changes | |
| git commit -m 'Update README.md with helm-docs' | |
| - name: Push changes | |
| if: success() | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GHA_COMMIT_TO_MASTER_PAT }} | |
| branch: main | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - update-readme | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| ref: main | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name 'Github Actions (${{ github.actor }})' | |
| git config --global user.email '[email protected]' | |
| - name: Run chart-releaser | |
| uses: bitdeps/[email protected] | |
| with: | |
| oci_registry: ghcr.io/comet-ml | |
| tag_name_pattern: '' | |
| oci_username: github-actions | |
| oci_password: ${{ secrets.GITHUB_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |