CI: publish docs to GitHub pages in forks, per branch.
This is useful for previewing how documentation renders in a PR.
This commit is contained in:
parent
4f70cd6294
commit
2d379d0010
25
.github/workflows/main.yaml
vendored
25
.github/workflows/main.yaml
vendored
|
@ -60,6 +60,9 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
- name: Pull tags from upstream repository
|
||||||
|
run: |
|
||||||
|
git pull --tags https://github.com/amaranth-lang/amaranth.git
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
|
@ -107,3 +110,25 @@ jobs:
|
||||||
branch: main
|
branch: main
|
||||||
folder: docs/
|
folder: docs/
|
||||||
target-folder: docs/amaranth/v${{ env.VERSION }}/
|
target-folder: docs/amaranth/v${{ env.VERSION }}/
|
||||||
|
publish-docs-dev:
|
||||||
|
needs: document
|
||||||
|
if: github.repository != 'amaranth-lang/amaranth'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out source code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Download documentation archive
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: docs
|
||||||
|
path: pages/docs/${{ github.ref_name }}/
|
||||||
|
- name: Disable Jekyll
|
||||||
|
run: |
|
||||||
|
touch pages/.nojekyll
|
||||||
|
- name: Publish documentation for a branch
|
||||||
|
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||||
|
with:
|
||||||
|
folder: pages/
|
||||||
|
clean: false
|
||||||
|
|
Loading…
Reference in a new issue