diff --git a/.github/workflows/release_web_app.yml b/.github/workflows/release_web_app.yml index 7c52153..b4dccfd 100644 --- a/.github/workflows/release_web_app.yml +++ b/.github/workflows/release_web_app.yml @@ -62,9 +62,14 @@ jobs: - name: Log in to GHCR uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GHCR_PAT }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Normalise repository name to lowercase + id: repo + run: | + echo "repo_lc=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT - name: Build and push uses: docker/build-push-action@v5 @@ -75,8 +80,8 @@ jobs: build-args: | APP_NAME=${{ needs.parse-tag.outputs.app }} tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ needs.parse-tag.outputs.app }}:${{ needs.parse-tag.outputs.version }} - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}/${{ needs.parse-tag.outputs.app }}:latest + ${{ env.REGISTRY }}/${{ steps.repo.outputs.repo_lc }}/${{ needs.parse-tag.outputs.app }}:${{ needs.parse-tag.outputs.version }} + ${{ env.REGISTRY }}/${{ steps.repo.outputs.repo_lc }}/${{ needs.parse-tag.outputs.app }}:latest helm: name: Package & Push Helm chart @@ -89,15 +94,21 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 with: + token: ${{ secrets.GITHUB_TOKEN }} version: v3.14.0 - name: Log in to GHCR (Helm OCI) run: | - echo "${{ secrets.GHCR_PAT }}" | \ + echo ${{ secrets.GITHUB_TOKEN }} | \ helm registry login ghcr.io \ - --username ${{ github.actor }} \ + --username ${{ github.repository_owner }} \ --password-stdin + - name: Normalise repository name to lowercase + id: repo + run: | + echo "repo_lc=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + - name: Sync versions in Chart and Values run: | CHART_DIR="apps/${{ needs.parse-tag.outputs.app }}/helm" @@ -130,4 +141,4 @@ jobs: CHART_PACKAGE=$(ls *.tgz) helm push "$CHART_PACKAGE" \ - oci://${{ env.REGISTRY }}/${{ github.repository }}/charts + oci://${{ env.REGISTRY }}/${{ steps.repo.outputs.repo_lc }}/charts