Skip to content

Commit 984d772

Browse files
authored
chore: Fix docs publish workflow (#79)
Previously, we were cloning the GH pages branch into a separate repository, updating it with a new index.yaml file, and then trying to use the launchdarkly/gh-actions/actions/publish-pages action to publish those modifications. However, that action assumes the docs directory ONLY contains publishable files. The .git files in our checkout were conflicting with the action's own checkout of gh-pages, resulting in a failure. This update modifies the commands so that we only read from the initial cloned repository, and operate only within a clean directory.
1 parent d595e69 commit 984d772

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

.github/actions/publish/action.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Publish Chart
2-
description: 'Publish to gh-pages-backed chart repository'
2+
description: "Publish to gh-pages-backed chart repository"
33
inputs:
44
dry_run:
5-
description: 'Is this a dry run. If so no package will be published.'
5+
description: "Is this a dry run. If so no package will be published."
66
required: true
77
token:
8-
description: 'The GitHub token used to upload artifacts to the published release'
8+
description: "The GitHub token used to upload artifacts to the published release"
99
required: true
1010

1111
runs:
@@ -27,22 +27,23 @@ runs:
2727
- name: Package the helm chart
2828
shell: bash
2929
run: |
30-
mkdir -p new_chart
31-
helm package -d new_chart .
30+
mkdir -p new-chart
31+
helm package -d new-chart .
3232
3333
- name: Generate updated index.yaml
3434
shell: bash
35-
run: helm repo index new_chart --url https://launchdarkly.github.io/ld-relay-helm --merge helm-repo/index.yaml
35+
run: helm repo index new-chart --url https://launchdarkly.github.io/ld-relay-helm --merge helm-repo/index.yaml
3636

3737
- name: Move files into publishable directory
3838
shell: bash
39-
run: mv new_chart/${{ steps.version.outputs.ARTIFACT }} new_chart/index.yaml helm-repo
39+
run: mv new-chart/${{ steps.version.outputs.ARTIFACT }} new-chart/index.yaml helm-repo
40+
run: mv helm-repo/*tgz new-chart/
4041

4142
- name: Publish to GitHub pages
4243
if: ${{ inputs.dry_run == 'false' }}
4344
uses: launchdarkly/gh-actions/actions/publish-pages@publish-pages-v1.0.2
4445
with:
45-
docs_path: helm-repo
46+
docs_path: new-chart
4647
github_token: ${{ inputs.token }}
4748

4849
- name: Attach published chart to release

0 commit comments

Comments
 (0)