Release to Production #56
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 | |
- uses: cycjimmy/semantic-release-action@v4 | |
id: semantic | |
with: | |
extra_plugins: | | |
[email protected] | |
@semantic-release/[email protected] | |
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 }} |