forked from acts-project/acts
-
Notifications
You must be signed in to change notification settings - Fork 6
102 lines (88 loc) · 3.69 KB
/
docs.yml
File metadata and controls
102 lines (88 loc) · 3.69 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
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
name: Docs
on:
push:
pull_request:
branches:
- main
- 'release/**'
- 'develop/**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
env:
DOXYGEN_WARN_AS_ERROR: FAIL_ON_WARNINGS
DOXYGEN_VERSION: "1.15.0"
DOXYGEN_HASH: "0ec2e5b2c3cd82b7106d19cb42d8466450730b8cb7a9e85af712be38bf4523a1"
LINKCHECK_IGNORE_URL: "https://github.com/acts-project/linkcheck-ignore/raw/refs/heads/main/data.json"
steps:
- uses: actions/checkout@v6
- name: Install doxygen
run: |
curl -SL https://acts.web.cern.ch/ci/doxygen/doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz -o doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz
echo "${{ env.DOXYGEN_HASH }} doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz" | sha256sum -c -
tar xf doxygen-${{ env.DOXYGEN_VERSION }}.linux.bin.tar.gz
mv doxygen-${{ env.DOXYGEN_VERSION }}/bin/doxygen /usr/local/bin/doxygen
- name: Install APT packages
run: |
sudo apt-get update
sudo apt-get install -y graphviz texlive-bibtex-extra libeigen3-dev libboost-dev cmake
- name: Configure
run: >
cmake -B build -S . -DACTS_BUILD_DOCS=ON
- name: Build documentation
run: >
cmake --build build --target docs
- name: Set up uv
uses: astral-sh/setup-uv@v7
- name: Check documentation links
run: |
docs/check_links.sh
- name: Generate PR metadata
if: github.event_name == 'pull_request'
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_BRANCH: ${{ github.head_ref }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_URL: ${{ github.event.pull_request.html_url }}
run: |
jq -n \
--arg pr "$PR_NUMBER" \
--arg branch "$PR_BRANCH" \
--arg title "$PR_TITLE" \
--arg url "$PR_URL" \
'{pr: ($pr | tonumber), branch: $branch, title: $title, url: $url}' \
> build/docs/html/pr.json
echo "Created pr.json for PR #$PR_NUMBER"
cat build/docs/html/pr.json
- uses: actions/upload-artifact@v7
id: artifact-upload-step
with:
name: acts-docs
path: build/docs/html
- name: Documentation display
run: |
base_link='https://acts-herald.app.cern.ch/view/${{ github.repository }}/${{ steps.artifact-upload-step.outputs.artifact-id }}'
link="$base_link/index.html"
echo "📚 Docs preview available at: $link"
echo "**📚 Documentation preview available [here]($link)**" >> $GITHUB_STEP_SUMMARY
# prime cache
(curl -L -m1 "$link" "$base_link/pr.json" > /dev/null 2>&1) || true
- name: Repository Dispatch
# Dispatch only if on a tag or on the main branch
if: >-
${{
github.event_name == 'push' &&
(
github.ref_type == 'tag' ||
(github.ref_type == 'branch' && github.ref_name == 'main')
)
}}
uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
repository: acts-project/acts-project.github.io
event-type: deploy_docs
client-payload: ${{ format('{{"source_repo":{0},"run_id":{1},"artifact_id":{2},"ref":{3},"ref_type":{4},"ref_name":{5},"sha":{6}}}', toJson(github.repository), toJson(github.run_id), toJson(steps.artifact-upload-step.outputs.artifact-id), toJson(github.ref), toJson(github.ref_type), toJson(github.ref_name), toJson(github.sha)) }}