Release to Production #240
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 to Production | |
on: | |
workflow_dispatch: | |
inputs: | |
chart_version: | |
type: string | |
required: true | |
default: current | |
description: Set to 'current' to use currently deployed chart version or '0.x.y' to specify chart | |
jobs: | |
semantic-release: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.releaseVersion.outputs.releaseVersion }} | |
steps: | |
- uses: actions/checkout@v3 | |
- run: npm install conventional-changelog-conventionalcommits | |
- uses: codfish/semantic-release-action@v2 | |
id: semantic | |
with: | |
repository_url: ${{ github.repositoryUrl }} | |
plugins: | | |
[ | |
['@semantic-release/commit-analyzer', { | |
"preset": "conventionalcommits", | |
"releaseRules": [ | |
{"type": "static", "release": "patch"}, | |
{"type": "chore", "release": "patch"}, | |
{"type": "helm", "release": false} | |
] | |
}], | |
['@semantic-release/release-notes-generator', { | |
"preset": "conventionalcommits", | |
"presetConfig": { | |
"types": [ | |
{"type": "feat", "section": "Features"}, | |
{"type": "fix", "section": "Bug Fixes"}, | |
{"type": "chore", "hidden": true}, | |
{"type": "docs", "hidden": true}, | |
{"type": "style", "hidden": true}, | |
{"type": "refactor", "hidden": true}, | |
{"type": "perf", "hidden": true}, | |
{"type": "test", "hidden": true}, | |
{"type": "static", "section": "Static Content"}, | |
{"type": "helm", "hidden": true} | |
] | |
}, | |
}], | |
['@semantic-release/github', { | |
"successComment": false, | |
"failTitle": false | |
}] | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: check version was generated | |
id: releaseVersion | |
run: | | |
if [[ -z "${{ steps.semantic.outputs.new_release_version }}" ]]; then | |
if [[ -z "$(git tag --points-at HEAD -l 'v*')" ]]; then | |
echo "No release version available" | |
exit 1 | |
else | |
echo "releaseVersion=$(git tag --points-at HEAD -l 'v*')" >> $GITHUB_OUTPUT | |
fi | |
else | |
echo "releaseVersion=${{ steps.semantic.outputs.new_release_version }}" >> $GITHUB_OUTPUT | |
fi | |
- name: "Version Info:" | |
run: echo "${{ steps.releaseVersion.outputs.releaseVersion }}" | |
deploy: | |
needs: semantic-release | |
uses: ./.github/workflows/production-deploy.yaml | |
secrets: inherit | |
with: | |
version: ${{ needs.semantic-release.outputs.version }} | |
chart_version: ${{ inputs.chart_version }} |