-
Notifications
You must be signed in to change notification settings - Fork 224
107 lines (85 loc) · 2.62 KB
/
Documentation.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Documentation
on:
push:
paths:
- 'docs/**'
- '.github/workflows/Documentation.yml'
pull_request:
paths:
- 'docs/**'
- '.github/workflows/Documentation.yml'
workflow_dispatch:
jobs:
doxygen:
runs-on: ubuntu-latest
name: 'SW Framework'
steps:
- name: '🧰 Repository Checkout'
uses: actions/checkout@v4
- name: '🛠️ Modifying Doxyfile'
run: |
ls -al ./docs
sed -i 's/$(PWD)\/../$(GITHUB_WORKSPACE)/g' ./docs/Doxyfile
- name: '📚 Generate Doxygen Documentation'
uses: mattnotmitt/[email protected]
with:
working-directory: '.'
doxyfile-path: 'docs/Doxyfile'
- name: '📤 Upload Artifact'
uses: actions/upload-artifact@v4
with:
name: NEORV32-Doxygen
path: doxygen_build/html
asciidoctor:
runs-on: ubuntu-latest
name: 'Datasheet'
steps:
- name: '🧰 Repository Checkout'
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: '📚 Build Datasheet and User Guide (PDF and HTML)'
run: make -C docs container
- name: '📤 Upload Artifact: HTML'
uses: actions/upload-artifact@v4
with:
name: NEORV32
path: docs/public
deploy:
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || contains(github.ref, 'refs/tags/'))
needs:
- doxygen
- asciidoctor
runs-on: ubuntu-latest
name: 'Deploy to Releases and Pages'
steps:
- name: '🧰 Repository Checkout'
uses: actions/checkout@v4
- name: '📥 Download Artifacts'
uses: actions/download-artifact@v4
- name: '🛠️ Organize public subdir and create a tarball'
run: |
mv NEORV32 public
mv public/pdf ./
mv NEORV32-Doxygen public/sw
tar zvcf NEORV32-SITE-nightly.tar.gz -C public .
cd pdf
mv NEORV32.pdf NEORV32-nightly.pdf
mv NEORV32_UserGuide.pdf NEORV32_UserGuide-nightly.pdf
# Tagged: create a pre-release or a release (semver)
# Untagged: update the assets of pre-release 'nightly'
- name: '📦 Deploy to GitHub-Releases'
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload nightly NEORV32-SITE-nightly.tar.gz pdf/NEORV32*nightly.pdf --clobber
- name: '🚀 Deploy to GitHub-Pages'
run: |
git init
cp ../.git/config ./.git/config
touch .nojekyll
git add .
git config --local user.email "push@gha"
git config --local user.name "GHA"
git commit -am 'update ${{ github.sha }}'
git push -u origin +HEAD:gh-pages