-
-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (66 loc) · 2.32 KB
/
update-docs.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
name: Update Docs
on:
push:
branches: [main]
jobs:
update-docs:
name: PixarUSD API Swift ${{ matrix.swift }} on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
swift: ["5.10"]
runs-on: ${{ matrix.os }}
steps:
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v2
- name: 👨💻 Install CxxStdlib
run: sudo apt install libstdc++-12-dev
- name: 📙 Install BZ2
run: sudo apt install libbz2-dev
- name: 📓 Install ZLib
run: sudo apt install zlib1g-dev
- name: 🐍 Install Python
run: sudo apt install python3-dev
- name: 🖼 Install FreeGLUT
run: sudo apt install freeglut3-dev
- name: 🚀 Install Boost
run: sudo apt install libboost-all-dev
- name: 🖥️ Install X11
run: sudo apt install libxcursor-dev libxt-dev libxi-dev libxinerama-dev libxrandr-dev
- name: Compile Docs
run: |
set -eux
git config user.email "[email protected]"
git config user.name "furby™"
git fetch
git worktree add --checkout gh-pages origin/gh-pages
export DOCC_JSON_PRETTYPRINT="YES"
export SWIFTPM_ENABLE_COMMAND_PLUGINS=1
swift package \
--allow-writing-to-directory gh-pages/docs \
generate-documentation \
--target PixarUSD \
--disable-indexing \
--transform-for-static-hosting \
--output-path gh-pages/docs
CURRENT_COMMIT_HASH=`git rev-parse --short HEAD`
cd gh-pages
# Inject our site at the index
rm docs/index.html
rm docs/favicon.ico
cp index.html docs
cp favicon.ico docs
cp CNAME docs
cp css/main.css docs/css
cp -R image docs
git add docs
# Commit changes
if [ -n "$(git status --porcelain)" ]; then
echo "Documentation changes found. Commiting the changes to the 'gh-pages' branch and pushing to origin."
git commit -m "Update GitHub Pages documentation site to '$CURRENT_COMMIT_HASH'."
git push origin HEAD:gh-pages
else
echo "No documentation changes found."
fi