Update release.yaml #72
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: Release Chart | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git | |
run: | | |
git config user.name blobbot-helm | |
git config user.email [email protected] | |
- name: Get chart.yaml verison | |
id: chart_version | |
run: | | |
echo "CHART_VERSION=$(grep -o 'version: [0-9.]*' Chart.yaml | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- name: Check if tag exists | |
id: tag_exists | |
run: | | |
if ! git show-ref --verify --quiet "refs/tags/${{ steps.chart_version.outputs.CHART_VERSION }}"; then | |
TAG_EXISTS=false | |
else | |
TAG_EXISTS=true | |
fi | |
echo "TAG_EXISTS=$TAG_EXISTS" >> $GITHUB_OUTPUT | |
- name: Tag release | |
id: tag_version | |
uses: mathieudutour/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.chart_version.outputs.CHART_VERSION }} | |
tag_prefix: "" | |
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | |
- name: Create release | |
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
name: ${{ steps.tag_version.outputs.new_tag }} | |
body: ${{ steps.tag_version.outputs.changelog }} | |
- name: Publish Helm chart | |
if: steps.tag_exists.outputs.TAG_EXISTS == 'false' | |
uses: stefanprodan/helm-gh-pages@89c6698c192e70ed0e495bee7d3d1ca5b477fe82 | |
with: | |
token: ${{ secrets.CHARTS_REPO_TOKEN }} | |
owner: benthosdev | |
repository: charts | |
branch: main | |
target_dir: benthos | |
index_dir: . | |
charts_dir: . | |
charts_url: https://benthosdev.github.io/charts | |
commit_username: blobbot-helm | |
commit_email: [email protected] |