Repository navigation
60 lines (49 loc) · 1.61 KB
/
Copy pathdocs.yml
File metadata and controls
60 lines (49 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Documentation
on:
push:
branches: [main]
paths:
- 'addons/**'
- 'NaturalDocs.Project/**'
- '.github/workflows/docs.yml'
permissions:
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install Natural Docs
run: |
curl -fsSL --retry 5 --retry-all-errors --retry-delay 5 \
"https://www.naturaldocs.org/download/natural_docs/2.4/Natural_Docs_2.4_Development_Release_2.Linux.x64.zip" \
-o nd.zip
# Guard against the server returning an error page (not a zip) or a truncated download.
if [ "$(head -c 2 nd.zip)" != "PK" ]; then
echo "::error::Natural Docs download is not a valid zip archive."
file nd.zip || true
exit 1
fi
unzip -q nd.zip -d naturaldocs
chmod +x "naturaldocs/Natural Docs/NaturalDocs"
- name: Install custom styles
run: cp -r NaturalDocs.Project/Styles/* "naturaldocs/Natural Docs/Styles/"
- name: Generate documentation
run: |
mkdir -p docs-output
"naturaldocs/Natural Docs/NaturalDocs" NaturalDocs.Project --rebuild
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
with:
path: docs-output
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5