-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from runkecheng/main
workflow: Manage Chart using Helm REPO. #290
- Loading branch information
Showing
2 changed files
with
87 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
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Publish Charts | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.6.3 | ||
|
||
- name: Packaging the chart | ||
run: helm package ./charts/mysql-operator/ | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: mysql-operator-chart | ||
path: ./mysql-operator-*.tgz | ||
retention-days: 1 | ||
|
||
publish: | ||
name: Publish charts on GitHub Pages | ||
runs-on: ubuntu-20.04 | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: operator-charts | ||
|
||
- name: Set up Helm | ||
uses: azure/setup-helm@v1 | ||
with: | ||
version: v3.6.3 | ||
|
||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: mysql-operator-chart | ||
|
||
- name: Update charts index | ||
run: | | ||
helm repo index --url https://radondb.github.io/radondb-mysql-kubernetes/ --merge index.yaml . | ||
git add . | ||
- name: Check diffs | ||
run: | | ||
diffs=$(git status -s) | ||
if [ "$diffs" = "" ]; then | ||
echo "NO_DIFF=1" >> $GITHUB_ENV | ||
else | ||
printf "%s\n" "$diffs" | ||
fi | ||
- name: Commit and push | ||
if: env.NO_DIFF != '1' | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: update chart repo | ||
|
||
- uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: operator-charts |