Skip to content

Commit 0f79f6f

Browse files
authored
Merge pull request #44 from fraya/divide-gh-doc-action
ci: Divide build and check documentation from deploy
2 parents 413410e + ca06c5c commit 0f79f6f

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and 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
43+
44+
- name: Upload html artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: command-line-parser
48+
path: documentation/build/html/
49+
50+
- name: Bypassing Jekyll on GH Pages
51+
run: sudo touch documentation/build/html/.nojekyll
52+
53+
- name: Deploy docs to GH pages
54+
uses: JamesIves/github-pages-deploy-action@v4
55+
with:
56+
folder: documentation/build/html

.github/workflows/build-and-deploy-documentation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name: Build and deploy documentation
33
on:
44
push:
55
# all branches
6-
pull_request:
6+
paths:
7+
- 'documentation/**'
78

89
# This enables the Run Workflow button on the Actions tab.
910
workflow_dispatch:

0 commit comments

Comments
 (0)