Fixed versioning for snapshot release type #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: Package and Push Helm Chart | ||
on: | ||
push: | ||
branches: | ||
- dev | ||
- release | ||
- devops/FAIRSPC-23_deployment | ||
workflow_dispatch: | ||
inputs: | ||
name: | ||
description: "Manual trigger for Helm chart packaging and pushing" | ||
release_type: | ||
description: "Release or snapshot version?" | ||
required: true | ||
default: "SNAPSHOT" | ||
options: | ||
- "SNAPSHOT" | ||
- "RELEASE" | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Setup Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: ${{ vars.HELM_VERSION }} | ||
- name: Login with Helm | ||
run: | | ||
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.HELM_REGISTRY }} --username ${{ github.repository_owner }} --password-stdin | ||
- name: Prepare version | ||
run: | | ||
VERSION=$(cat ./VERSION) | ||
# if [[ ${{ github.event.inputs.release_type }} = "SNAPSHOT" ]] || [[ $BRANCH = "dev" ]]; then | ||
# VERSION=$VERSION-SNAPSHOT | ||
# fi | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Push Helm chart to repository | ||
run: | | ||
helm dependency update "charts/fairspace" | ||
helm package "charts/fairspace" --version ${{ env.VERSION }} | ||
helm push "fairspace-${{ env.VERSION }}.tgz" "oci://${{ vars.HELM_REGISTRY }}" | ||
echo "Pushed package to repository" | ||
- name: Clean up | ||
run: | | ||
rm -rf "fairspace*.tgz" |