Skip to content

Commit

Permalink
manual
Browse files Browse the repository at this point in the history
  • Loading branch information
EliMoshkovich committed Feb 28, 2024
1 parent cc46ba3 commit 0b36100
Showing 1 changed file with 49 additions and 9 deletions.
58 changes: 49 additions & 9 deletions .github/workflows/helm_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on: push
# - v2
# workflow_dispatch:

permissions: write-all

jobs:
helm-release:
runs-on: ubuntu-latest
Expand All @@ -24,6 +26,44 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v1

- name: Generate Random Semantic Version
id: random-version
run: echo "::set-output name=version::$(echo v0.$((1 + RANDOM % 9)).$((1 + RANDOM % 9)))-${{ github.run_number }}"

- name: Package Helm Chart
run: |
helm package --version ${{ steps.random-version.outputs.version }} ./helm
- name: Copy chart file
run: |
mkdir -p ./upload
cp ${{ github.workspace }}/pdp-${{ steps.random-version.outputs.version }}.tgz ./upload/
- name: Upload chart file
uses: actions/upload-artifact@v2
with:
name: ${{ github.workspace }}/pdp-${{ steps.random-version.outputs.version }}
path: ./upload

- name: Checkout gh-pages branch
uses: actions/checkout@v3
with:
ref: gh-pages

- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ${{ github.workspace }}/pdp-${{ steps.random-version.outputs.version }}

- name: Update chart repo index in gh-pages branch
run: |
helm repo index --merge index.yaml .
git config --local user.email "[email protected]"
git config --local user.name "elimoshkovich"
git add .
git commit -m "feat: Update chart index with version ${{ steps.random-version.outputs.version }}"
git push https://elimoshkovich:${{ secrets.PAGES }}@github.com/elimoshkovich/permitio/sidecar.git HEAD:gh-pages -
# - name: Run User chart-releaser
# uses: helm/[email protected]
# env:
Expand All @@ -32,12 +72,12 @@ jobs:
# charts_dir: ./helm/Chart.yaml
# packages_with_index: true
# pages_branch: 'gh-pages'
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.PAGES }}
charts_dir: ./helm
charts_url: https://permitio.github.io
owner: permitio
repository: sidecar
branch: gh-pages
# - name: Publish Helm charts
# uses: stefanprodan/helm-gh-pages@master
# with:
# token: ${{ secrets.PAGES }}
# charts_dir: ./helm
# charts_url: https://permitio.github.io
# owner: permitio
# repository: sidecar
# branch: gh-pages

0 comments on commit 0b36100

Please sign in to comment.