File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Inputs:
1212* ` repository ` The GitHub repository, defaults to the ` GITHUB_REPOSITORY ` env var
1313* ` branch ` The branch to publish charts, defaults to ` gh-pages `
1414* ` helm_version ` The Helm CLI version, defaults to the latest release
15+ * ` target_dir ` The target directory to store the charts, defaults to ` . `
1516
1617## Examples
1718
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 @@ -26,6 +26,9 @@ inputs:
2626 helm_version :
2727 description : " The Helm CLI version"
2828 required : false
29+ target_dir :
30+ description : " The target directory to store the charts, defaults to `.`"
31+ required : false
2932runs :
3033 using : ' docker'
3134 image : ' Dockerfile'
3639 - ${{ inputs.user }}
3740 - ${{ inputs.repository }}
3841 - ${{ inputs.branch }}
39- - ${{ inputs.helm_version }}
42+ - ${{ inputs.helm_version }}
43+ - ${{ inputs.target_dir }}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ OWNER=$4
1010REPOSITORY=$5
1111BRANCH=$6
1212HELM_VERSION=$7
13+ TARGET_DIR=$8
1314
1415CHARTS=()
1516CHARTS_TMP_DIR=$( mktemp -d)
@@ -37,6 +38,10 @@ 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
@@ -103,10 +108,11 @@ upload() {
103108
104109 charts=$( cd ${CHARTS_TMP_DIR} && ls * .tgz | xargs)
105110
106- mv -f ${CHARTS_TMP_DIR} /* .tgz .
107- helm repo index . --url ${CHARTS_URL}
111+ mkdir -p ${TARGET_DIR}
112+ mv -f ${CHARTS_TMP_DIR} /* .tgz ${TARGET_DIR}
113+ helm repo index ${TARGET_DIR} --url ${CHARTS_URL}
108114
109- git add .
115+ git add ${TARGET_DIR}
110116 git commit -m " Publish $charts "
111117 git push origin gh-pages
112118
You can’t perform that action at this time.
0 commit comments