diff --git a/.github/workflows/build_and_upload_on_push_to_dev.yaml b/.github/workflows/build_and_upload_on_push_to_dev.yaml index 5c93f8636..6e37ad437 100644 --- a/.github/workflows/build_and_upload_on_push_to_dev.yaml +++ b/.github/workflows/build_and_upload_on_push_to_dev.yaml @@ -194,7 +194,7 @@ jobs: uses: docker/login-action@v3 with: registry: ${{ env.DOCKER_REGISTRY }} - username: ${{ github.actor }} + username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker diff --git a/.github/workflows/deploy_helm_chart.yaml b/.github/workflows/deploy_helm_chart.yaml index 48b53944b..cbdc7dda5 100644 --- a/.github/workflows/deploy_helm_chart.yaml +++ b/.github/workflows/deploy_helm_chart.yaml @@ -46,7 +46,7 @@ jobs: - name: Define Helm Chart version (taken from input or latest snapshot) run: | - VERSION=$(cat ./VERSION)-SNAPSHOT + VERSION=$(cat ./VERSION) if [ -n "${{ github.event.inputs.version }}" ]; then VERSION=${{ github.event.inputs.version }} fi diff --git a/.github/workflows/package_and_push_helm_chart.yaml b/.github/workflows/package_and_push_helm_chart.yaml index eab06a9de..7461ce20d 100644 --- a/.github/workflows/package_and_push_helm_chart.yaml +++ b/.github/workflows/package_and_push_helm_chart.yaml @@ -9,13 +9,9 @@ on: 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" + version: + description: "Version of the Helm chart to push" + required: false jobs: deploy: @@ -32,14 +28,20 @@ jobs: - name: Login with Helm run: | - echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.HELM_REGISTRY }} --username ${{ github.repository_owner }} --password-stdin + echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.HELM_REGISTRY }} --username ${{ github.actor }} --password-stdin - name: Prepare version run: | VERSION=$(cat ./VERSION) - if [[ ${{ github.event.inputs.release_type }} = "SNAPSHOT" ]] || [[ $BRANCH = "dev" ]]; then + BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} + if [ $BRANCH != "release" ] + then VERSION=$VERSION-SNAPSHOT fi + # override version of custom input is provided + if [ "${{ github.event.inputs.version != '' }}" ]; then + VERSION=${{ github.event.inputs.version }} + fi echo "VERSION=$VERSION" >> $GITHUB_ENV - name: Push Helm chart to repository @@ -48,7 +50,3 @@ jobs: 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"