Skip to content

Commit aeb4f9b

Browse files
[wiki] Publish merged docs to wiki master (#48) (#50)
* Fix wiki publish branch * Update wiki submodule pointer for PR #50 * Delete published wiki preview branch --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e3f3913 commit aeb4f9b

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

.github/wiki

Submodule wiki updated from aef19f1 to 27c2a17

.github/workflows/wiki.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ jobs:
112112
push: true
113113

114114
publish:
115-
name: Publish Wiki Main
115+
name: Publish Wiki Master
116116
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main'
117117
runs-on: ubuntu-latest
118118

119119
env:
120+
WIKI_PUBLISH_BRANCH: master
120121
WIKI_PREVIEW_BRANCH: pr-${{ github.event.pull_request.number }}
121122

122123
steps:
@@ -133,19 +134,23 @@ jobs:
133134
git config --global --add safe.directory "$GITHUB_WORKSPACE"
134135
git config --global --add safe.directory "$GITHUB_WORKSPACE/.github/wiki"
135136
136-
- name: Prepare wiki main branch from preview branch
137+
- name: Prepare wiki publish branch from preview branch
137138
working-directory: .github/wiki
138139
run: |
139-
git fetch origin main "${WIKI_PREVIEW_BRANCH}"
140-
git switch -C main --track origin/main || git switch main
140+
git fetch origin "${WIKI_PUBLISH_BRANCH}" "${WIKI_PREVIEW_BRANCH}"
141+
git switch -C "${WIKI_PUBLISH_BRANCH}" --track "origin/${WIKI_PUBLISH_BRANCH}" || git switch "${WIKI_PUBLISH_BRANCH}"
141142
git reset --hard "origin/${WIKI_PREVIEW_BRANCH}"
142143
git clean -fd
143144
144-
- name: Commit & push wiki main branch
145+
- name: Commit & push wiki publish branch
145146
uses: EndBug/add-and-commit@v10
146147
with:
147148
cwd: .github/wiki
148149
add: .
149150
message: "Publish wiki docs from PR #${{ github.event.pull_request.number }}"
150151
default_author: github_actions
151-
push: origin HEAD:main
152+
push: origin HEAD:${{ env.WIKI_PUBLISH_BRANCH }}
153+
154+
- name: Delete wiki preview branch
155+
working-directory: .github/wiki
156+
run: git push origin --delete "${WIKI_PREVIEW_BRANCH}"

0 commit comments

Comments
 (0)