Skip to content

Commit 3427c0c

Browse files
Deploy docs to Github pages
1 parent eeb81ee commit 3427c0c

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed

.github/scripts/build-gh-pages.sh

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
set -e
4+
sudo apt-get update >/dev/null
5+
sudo apt-get install -y git cmake doxygen graphviz >/dev/null
6+
7+
#List of branches to build docs for
8+
#TODO: Remove doxygen branch once tested
9+
BRANCHES="doxygen master develop"
10+
11+
build-docs() (
12+
git checkout $1
13+
14+
#The CMake Doxygen stuff is weird, and doesn't
15+
#properly clean up and/or overwrite old outputs.
16+
#So to make sure we get the correct doc configs,
17+
#we need to delete everything
18+
#We put the docs themselves into a hidden directory
19+
#so they don't get included in this glob
20+
rm -rf ./*
21+
22+
cmake ../ -DBUILD_DOCS=ON -DDOCS_ONLY=ON \
23+
-DFENIX_DOCS_MAN=OFF -DFENIX_BRANCH=$1 \
24+
-DFENIX_DOCS_OUTPUT=$PWD/.docs
25+
make doc
26+
)
27+
28+
git clone https://www.github.com/sandialabs/Fenix.git
29+
mkdir Fenix/build
30+
cd Fenix/build
31+
32+
for branch in $BRANCHES; do
33+
echo "Building docs for $branch"
34+
35+
#TODO: Fail if any branch fails to build,
36+
# once the develop and master branches have doxygen
37+
# merged in
38+
build-docs $branch || true
39+
40+
echo
41+
echo
42+
done
43+
44+
if [ -n "$GITHUB_ENV" ]; then
45+
echo "DOCS_DIR=$PWD/.docs" >> $GITHUB_ENV
46+
fi

.github/workflows/docs.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish GH Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- develop
8+
- doxygen # TODO: Remove after testing
9+
10+
#Only one of this workflow runs at a time
11+
concurrency:
12+
group: docs
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build-pages:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Build pages
23+
run: /bin/bash .github/scripts/build-gh-pages.sh
24+
25+
- name: Upload documentation artifact
26+
uses: actions/upload-pages-artifact@v3
27+
with:
28+
path: ${{ env.DOCS_DIR }}
29+
30+
deploy-docs:
31+
needs: build-pages
32+
runs-on: ubuntu-latest
33+
permissions:
34+
pages: write
35+
id-token: write
36+
37+
steps:
38+
- name: Deploy documentation to GH Pages
39+
uses: actions/deploy-pages@v4
40+

0 commit comments

Comments
 (0)