Skip to content

Commit 240332c

Browse files
committed
ci: Separate document deployment from pull request checks
Separate the task of checking document links and building them from the deployment to GitHub Pages. The GitHub Actions runner lacks the necessary privileges to deploy the documentation during pull requests, which caused link checking errors.
1 parent c8fb1d0 commit 240332c

File tree

2 files changed

+43
-5
lines changed

2 files changed

+43
-5
lines changed

.github/workflows/build-docs.yml renamed to .github/workflows/build-and-deploy-docs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
name: Build documentation
1+
name: Build and deploy docs
22

33
on:
44
push:
55
# all branches
66
paths:
77
- 'documentation/**'
8-
pull_request:
9-
# all branches
10-
paths:
11-
- 'documentation/**'
128

139
# This enables the Run Workflow button on the Actions tab.
1410
workflow_dispatch:

.github/workflows/check-docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Check documentation
2+
3+
on:
4+
pull_request:
5+
# all branches
6+
paths:
7+
- 'documentation/**'
8+
9+
# This enables the Run Workflow button on the Actions tab.
10+
workflow_dispatch:
11+
12+
# https://github.com/JamesIves/github-pages-deploy-action#readme
13+
permissions:
14+
contents: write
15+
16+
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are
17+
# installed in ../../_packages relative to documentation's Makefile
18+
env:
19+
DYLAN: ${{ github.workspace }}
20+
21+
jobs:
22+
23+
build-and-deploy:
24+
runs-on: ubuntu-latest
25+
steps:
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v4
29+
30+
- name: Check links
31+
uses: addnab/docker-run-action@v3
32+
with:
33+
image: ghcr.io/fraya/dylan-docs
34+
options: -v ${{ github.workspace }}/documentation:/docs
35+
run: make linkcheck
36+
37+
- name: Build docs with Furo theme
38+
uses: addnab/docker-run-action@v3
39+
with:
40+
image: ghcr.io/fraya/dylan-docs
41+
options: -v ${{ github.workspace }}/documentation:/docs
42+
run: make html

0 commit comments

Comments
 (0)