File tree Expand file tree Collapse file tree 3 files changed +21
-5
lines changed
Expand file tree Collapse file tree 3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Inputs:
1111* ` owner ` The GitHub user or org that owns this repository, defaults to the owner in ` GITHUB_REPOSITORY ` env var
1212* ` repository ` The GitHub repository, defaults to the ` GITHUB_REPOSITORY ` env var
1313* ` branch ` The branch to publish charts, defaults to ` gh-pages `
14+ * ` target_dir ` The target directory to store the charts, defaults to ` . `
1415* ` helm_version ` The Helm CLI version, defaults to the latest release
1516
1617## Examples
5657 owner: fluxcd
5758 repository: charts
5859 branch: gh-pages
60+ target_dir: charts
5961` ` `
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ inputs:
2323 branch :
2424 description : " The branch to publish charts, defaults to `gh-pages`"
2525 required : false
26+ target_dir :
27+ description : " The target directory to store the charts, defaults to `.`"
28+ required : false
2629 helm_version :
2730 description : " The Helm CLI version"
2831 required : false
3639 - ${{ inputs.user }}
3740 - ${{ inputs.repository }}
3841 - ${{ inputs.branch }}
39- - ${{ inputs.helm_version }}
42+ - ${{ inputs.target_dir }}
43+ - ${{ inputs.helm_version }}
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ CHARTS_URL=$3
99OWNER=$4
1010REPOSITORY=$5
1111BRANCH=$6
12- HELM_VERSION=$7
12+ TARGET_DIR=$7
13+ HELM_VERSION=$8
1314
1415CHARTS=()
1516CHARTS_TMP_DIR=$( mktemp -d)
@@ -37,10 +38,18 @@ main() {
3738 BRANCH=" gh-pages"
3839 fi
3940
41+ if [[ -z " $TARGET_DIR " ]]; then
42+ TARGET_DIR=" ."
43+ fi
44+
4045 if [[ -z " $CHARTS_URL " ]]; then
4146 CHARTS_URL=" https://${OWNER} .github.io/${REPOSITORY} "
4247 fi
4348
49+ if [[ " $TARGET_DIR " != " ." ]]; then
50+ CHARTS_URL=" ${CHARTS_URL} /${TARGET_DIR} "
51+ fi
52+
4453 if [[ -z " $REPO_URL " ]]; then
4554 REPO_URL=" https://x-access-token:${GITHUB_TOKEN} @github.com/${OWNER} /${REPOSITORY} "
4655 fi
@@ -103,10 +112,11 @@ upload() {
103112
104113 charts=$( cd ${CHARTS_TMP_DIR} && ls * .tgz | xargs)
105114
106- mv -f ${CHARTS_TMP_DIR} /* .tgz .
107- helm repo index . --url ${CHARTS_URL}
115+ mkdir -p ${TARGET_DIR}
116+ mv -f ${CHARTS_TMP_DIR} /* .tgz ${TARGET_DIR}
117+ helm repo index ${TARGET_DIR} --url ${CHARTS_URL}
108118
109- git add .
119+ git add ${TARGET_DIR}
110120 git commit -m " Publish $charts "
111121 git push origin gh-pages
112122
You can’t perform that action at this time.
0 commit comments