diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index 0759dbf1..0dca790c 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -33,11 +33,6 @@ jobs: docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }} docker push quay.io/${{ github.repository }}:latest - - name: Configure git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Release Helm chart run: | ansible-playbook ansible/helm-release.yml -v \ @@ -45,3 +40,4 @@ jobs: -e chart_owner=${{ github.repository_owner }} \ -e tag=${{ github.event.release.tag_name }} \ -e gh_token=${{ secrets.GITHUB_TOKEN }} + -e gh_user=${{ github.actor }} diff --git a/Makefile b/Makefile index 9d4af9f7..e1b4f9d2 100644 --- a/Makefile +++ b/Makefile @@ -395,9 +395,3 @@ helm-index: $(HELM) repo index .cr-release-packages --url https://github.com/$(CHART_OWNER)/$(CHART_REPO)/releases/download/ --merge gh-pages/index.yaml mv .cr-release-packages/index.yaml gh-pages/index.yaml - - @echo "== PUSH INDEX FILE ==" - cd gh-pages;\ - git add index.yaml;\ - git commit -m "Updated index.yaml latest release";\ - git push;\ diff --git a/ansible/helm-release.yml b/ansible/helm-release.yml index 47e2c8e7..bc95b887 100644 --- a/ansible/helm-release.yml +++ b/ansible/helm-release.yml @@ -37,6 +37,11 @@ register: asset_upload changed_when: asset_upload.json.state == "uploaded" + - name: Configure git config + run: | + git config user.name "{{ gh_user }}" + git config user.email "{{ gh_user }}@users.noreply.github.com" + - name: Publish helm index command: | make helm-index @@ -45,3 +50,11 @@ CR_TOKEN: "{{ gh_token }}" args: chdir: "{{ playbook_dir }}/../" + + - name: Stage and Push commit to gh-pages branch + command: | + git add index.yaml + git commit -m "Updated index.yaml latest release" + git push + args: + chdir: "{{ playbook_dir }}/../gh-pages"