Skip to content

Commit

Permalink
Merge pull request #294 from runkecheng/main
Browse files Browse the repository at this point in the history
workflow: Manage Chart using Helm REPO. #290
  • Loading branch information
andyli029 authored Nov 22, 2021
2 parents 896aae5 + 582991f commit a35f83b
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/code_check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: code check

on: [push, pull_request]
on:
push:
branches: [ main ]
paths-ignore:
- .github/**
- charts/**
- config/**
- docs/**
- hack/**
pull_request:
branches: [ main ]
paths-ignore:
- .github/**
- charts/**
- config/**
- docs/**
- hack/**

jobs:

Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/publish_charts.yml
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

0 comments on commit a35f83b

Please sign in to comment.