Merge pull request #25 from energywebfoundation/feat/enable_redis_con… #8
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 helm chart' | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- Chart.yaml | |
jobs: | |
cancel-previous: | |
name: Cancel Previous Runs | |
runs-on: ubuntu-latest | |
timeout-minutes: 3 | |
steps: | |
- uses: styfle/cancel-workflow-action@0.11.0 | |
with: | |
access_token: ${{ github.token }} | |
push-tag: | |
name: Push tag | |
runs-on: ubuntu-latest | |
needs: [cancel-previous] | |
outputs: | |
chart-version: ${{ steps.chart-version.outputs.CHART_VERSION }} | |
changelog: ${{ steps.tag_version.outputs.changelog }} | |
tag: ${{ steps.tag_version.outputs.new_tag }} | |
steps: | |
- uses: actions/checkout@v2 | |
# Take the 1st version from Chart.yaml | |
- name: Get Chart Version | |
id: chart-version | |
run: | | |
echo "CHART_VERSION=$(grep "version:" Chart.yaml | awk '{print $2}' | head -n 1)" >> $GITHUB_OUTPUT | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
release_branches: master | |
custom_tag: ${{ steps.chart-version.outputs.CHART_VERSION }} | |
custom_release_rules: major:major:Major Changes,minor:minor:Minor Changes,chore:patch:Chores | |
release: | |
name: Release helm chart | |
runs-on: ubuntu-latest | |
needs: [push-tag] | |
steps: | |
- name: Create a GitHub release | |
uses: ncipollo/release-action@v1.12.0 | |
with: | |
tag: ${{ needs.push-tag.outputs.tag }} | |
name: Release ${{ needs.push-tag.outputs.tag }} | |
body: ${{ needs.push-tag.outputs.changelog }} | |
- uses: actions/checkout@v2 | |
- name: Push Helm chart to OCI compatible registry (Github) | |
uses: bsord/helm-push@v4.2.0 | |
with: | |
useOCIRegistry: true | |
registry-url: oci://ghcr.io/${{ github.repository_owner }} | |
username: ${{ github.actor }} | |
access-token: ${{ secrets.GITHUB_TOKEN }} | |
force: true | |
chart-folder: ./ |