Skip to content

Commit

Permalink
Update publish-helm.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprasad-sap authored Sep 27, 2023
1 parent 4e8fd3d commit 43209ff
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions .github/workflows/publish-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,12 @@ jobs:
with:
fetch-depth: 0

- name: Create helm-index branch if missing
run: |
if ! git rev-parse --verify remotes/origin/helm-index &>/dev/null; then
git switch --orphan helm-index
git config user.name "${{ vars.WORKFLOW_USER_NAME }}"
git config user.email "${{ vars.WORKFLOW_USER_EMAIL }}"
git commit --allow-empty -m "Initial commit"
git push --set-upstream origin helm-index
fi
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: helm-index
path: index
ref: website
path: website
token: ${{ secrets.WORKFLOW_USER_TOKEN }}

- uses: azure/setup-helm@v3
with:
Expand All @@ -104,13 +95,13 @@ jobs:
- name: Create index
run: |
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
helm repo index --url ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ needs.create_release_tag.outputs.tag }} --merge ./index/index.yaml .
mv index.yaml index
cd index
helm repo index --url ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ needs.create_release_tag.outputs.tag }} --merge ./website/static/index.yaml .
mv index.yaml website/static
cd website
git config user.name "${{ vars.WORKFLOW_USER_NAME }}"
git config user.email "${{ vars.WORKFLOW_USER_EMAIL }}"
git add index.yaml
git commit -m "Release ${{ needs.create_release_tag.outputs.tag }}"
git add .
git commit -m "Add index.yaml to website"
git push
- name: Checkout repository
Expand All @@ -119,16 +110,6 @@ jobs:
ref: website
path: website
token: ${{ secrets.WORKFLOW_USER_TOKEN }}

- name: Copy index.yaml to website branch
run: |
cat index/index.yaml > website/static/index.yaml
cd website
git config user.name "${{ vars.WORKFLOW_USER_NAME }}"
git config user.email "${{ vars.WORKFLOW_USER_EMAIL }}"
git add .
git commit -m "Add index.yaml to website"
git push

- name: Upload package
run: |
Expand Down

0 comments on commit 43209ff

Please sign in to comment.