Skip to content

Commit 4f70cd6

Browse files
committed
CI: split document and publish steps, and skip publish in forks.
1 parent 4398575 commit 4f70cd6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/main.yaml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,29 @@ jobs:
7171
- name: Build documentation
7272
run: |
7373
sphinx-build docs docs/_build
74+
- name: Upload documentation archive
75+
uses: actions/upload-artifact@v3
76+
with:
77+
name: docs
78+
path: docs/_build
79+
publish-docs:
80+
needs: document
81+
if: github.repository == 'amaranth-lang/amaranth'
82+
runs-on: ubuntu-latest
83+
steps:
84+
- name: Download documentation archive
85+
uses: actions/download-artifact@v3
86+
with:
87+
name: docs
88+
path: docs/
7489
- name: Publish development documentation
7590
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
7691
uses: JamesIves/github-pages-deploy-action@releases/v4
7792
with:
7893
repository-name: amaranth-lang/amaranth-lang.github.io
7994
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
8095
branch: main
81-
folder: docs/_build
96+
folder: docs/
8297
target-folder: docs/amaranth/latest/
8398
- name: Extract release version
8499
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
@@ -90,5 +105,5 @@ jobs:
90105
repository-name: amaranth-lang/amaranth-lang.github.io
91106
ssh-key: ${{ secrets.PAGES_DEPLOY_KEY }}
92107
branch: main
93-
folder: docs/_build
108+
folder: docs/
94109
target-folder: docs/amaranth/v${{ env.VERSION }}/

0 commit comments

Comments
 (0)