-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(helm): add ci to publish helm chart
- Loading branch information
Showing
1 changed file
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ on: | |
tags: | ||
- "**" | ||
|
||
env: | ||
REPO_NAME: be-friend | ||
PAGES_BRANCH: gh-pages | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -41,4 +45,50 @@ jobs: | |
tags: | | ||
ghcr.io/${{ github.repository }}:${{ github.sha }} | ||
ghcr.io/${{ github.repository }}:${{ github.ref_name }} | ||
ghcr.io/${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository }}:latest | ||
helm-chart: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.8.1 | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
path: ${{ env.REPO_NAME }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
fetch-depth: 0 | ||
ref: ${{ env.PAGES_BRANCH }} | ||
path: ${{ env.PAGES_BRANCH }} | ||
|
||
- run: tree . | ||
|
||
- name: package charts | ||
run: | | ||
echo ${PWD} | ||
cd ${{ env.REPO_NAME }} | ||
echo "TAG: ${GITHUB_REF_NAME}" | ||
sed -i "s/version:.*/version: ${GITHUB_REF_NAME}/" helm/Chart.yaml | ||
sed -i "s/appVersion:.*/appVersion: \"${GITHUB_REF_NAME}\"/" helm/Chart.yaml | ||
helm package helm --destination ../${{ env.PAGES_BRANCH }} | ||
helm repo index ../${{ env.PAGES_BRANCH }} --url https://${{ github.repository_owner }}.github.io/${{ env.REPO_NAME }} | ||
- name: push chart to ${{ env.PAGES_BRANCH }} | ||
run: | | ||
echo ${PWD} | ||
cd ${{ env.PAGES_BRANCH }} | ||
git config --local user.name "${{ github.repository_owner }}" | ||
git config --local user.email "[email protected]" | ||
git remote set-url origin https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | ||
git add -A | ||
git commit -m "Update helm chart ${GITHUB_REF_NAME}" | ||
git push -u origin ${{ env.PAGES_BRANCH }} |