-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a publish-docs workflow and rely on release branch
This creates docs from master/release branches in the ci workflow which is used as as sources for the unstable/stable versions of the docs. The publish-docs workflow will then just aggregate the two versions and pushes it to github pages.
- Loading branch information
Showing
2 changed files
with
85 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: "Publish Docs" | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["CI"] | ||
branches: [master, release] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publishing: | ||
name: Publish Documentation | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- name: 📥 Download stable (last released) docs | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: ci.yaml | ||
workflow_conclusion: success | ||
branch: release | ||
name: stable | ||
path: docs/public/ | ||
|
||
- name: 📥 Download & merge unstable docs with released | ||
uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: ci.yaml | ||
workflow_conclusion: success | ||
branch: master | ||
name: unstable | ||
path: docs/public/unstable | ||
|
||
# TODO: remove debugging steps | ||
|
||
- name: DEBUG contents | ||
run: | | ||
find docs/ | ||
- name: DEBUG contents | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: head-protocol | ||
path: docs/public | ||
|
||
- name: 🚢 Publish Documentation | ||
if: github.event_name == 'push' | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN || github.token }} | ||
publish_dir: docs/public | ||
enable_jekyll: true | ||
force_orphan: true | ||
|