Skip to content

Commit 2d379d0

Browse files
committed
CI: publish docs to GitHub pages in forks, per branch.
This is useful for previewing how documentation renders in a PR.
1 parent 4f70cd6 commit 2d379d0

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/main.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060
uses: actions/checkout@v3
6161
with:
6262
fetch-depth: 0
63+
- name: Pull tags from upstream repository
64+
run: |
65+
git pull --tags https://github.com/amaranth-lang/amaranth.git
6366
- name: Set up Python
6467
uses: actions/setup-python@v4
6568
with:
@@ -107,3 +110,25 @@ jobs:
107110
branch: main
108111
folder: docs/
109112
target-folder: docs/amaranth/v${{ env.VERSION }}/
113+
publish-docs-dev:
114+
needs: document
115+
if: github.repository != 'amaranth-lang/amaranth'
116+
runs-on: ubuntu-latest
117+
steps:
118+
- name: Check out source code
119+
uses: actions/checkout@v3
120+
with:
121+
fetch-depth: 0
122+
- name: Download documentation archive
123+
uses: actions/download-artifact@v3
124+
with:
125+
name: docs
126+
path: pages/docs/${{ github.ref_name }}/
127+
- name: Disable Jekyll
128+
run: |
129+
touch pages/.nojekyll
130+
- name: Publish documentation for a branch
131+
uses: JamesIves/github-pages-deploy-action@releases/v4
132+
with:
133+
folder: pages/
134+
clean: false

0 commit comments

Comments
 (0)