File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ Inputs:
1616* ` linting ` Toggle Helm linting, can be disabled by setting it to ` off `
1717* ` commit_username ` Explicitly specify username for commit back, default to ` GITHUB_ACTOR `
1818* ` commit_email ` Explicitly specify email for commit back, default to ` GITHUB_ACTOR@users.noreply.github.com `
19+ * ` app_version ` Explicitly specify app version in package. If not defined then used chart values.
20+ * ` chart_version ` Explicitly specify chart version in package. If not defined then used chart values.
1921
2022## Examples
2123
6466 commit_username: johndoe
6567 commit_email: johndoe@example.com
6668` ` `
69+ Package chart with specified chart & app versions and push all charts in `./charts` dir to `gh-pages` branch :
70+ ` ` ` yaml
71+ name: release
72+ on:
73+ push:
74+ tags: '*'
75+
76+ jobs:
77+ release:
78+ runs-on: ubuntu-latest
79+ steps:
80+ - uses: actions/checkout@v2
81+ - name: Publish Helm charts
82+ uses: stefanprodan/helm-gh-pages@master
83+ with:
84+ token: ${{ secrets.GITHUB_TOKEN }}
85+ app_version: 1.16.0
86+ chart_version: 0.1.0
87+ ` ` `
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ inputs:
4040 description : " The email used for the commit user"
4141 required : false
4242 default : ${{ github.actor }}@users.noreply.github.com
43+ app_version :
44+ description : " Set the appVersion on the chart to this version"
45+ required : false
46+ chart_version :
47+ description : " Set the version on the chart to this version"
48+ required : false
4349runs :
4450 using : ' docker'
4551 image : ' Dockerfile'
5561 - ${{ inputs.linting }}
5662 - ${{ inputs.commit_username }}
5763 - ${{ inputs.commit_email }}
64+ - ${{ inputs.app_version }}
65+ - ${{ inputs.chart_version }}
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ HELM_VERSION=$8
2828LINTING=$9
2929COMMIT_USERNAME=${10}
3030COMMIT_EMAIL=${11}
31+ APP_VERSION=${12}
32+ CHART_VERSION=${13}
3133
3234CHARTS=()
3335CHARTS_TMP_DIR=$( mktemp -d)
@@ -123,7 +125,10 @@ lint() {
123125}
124126
125127package () {
126- helm package ${CHARTS[*]} --destination ${CHARTS_TMP_DIR}
128+ [[ -z $APP_VERSION ]] || APP_VERSION_CMD=" --app-version $APP_VERSION " ;
129+ [[ -z $CHART_VERSION ]] || CHART_VERSION_CMD=" --version $CHART_VERSION "
130+
131+ helm package ${CHARTS[*]} --destination ${CHARTS_TMP_DIR} " $APP_VERSION_CMD " " $CHART_VERSION_CMD "
127132}
128133
129134upload () {
You can’t perform that action at this time.
0 commit comments