-
-
Notifications
You must be signed in to change notification settings - Fork 11
76 lines (65 loc) · 2.34 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
# Build and deploy DocC to GitHub pages. Based off of pointfreeco/swift-composable-architecture:
# https://github.com/pointfreeco/swift-composable-architecture/blob/main/.github/workflows/documentation.yml
name: Documentation
on:
release:
types:
- published
push:
branches:
- master
workflow_dispatch:
concurrency:
group: docs-${{ github.ref }}
cancel-in-progress: true
jobs:
documentation:
runs-on: macos-14
steps:
- name: Select Xcode 16.0
run: sudo xcode-select -s /Applications/Xcode_16.0.app
- name: Checkout Package
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout gh-pages Branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: docs
- name: Build documentation
run: >
rm -rf docs/.git;
rm -rf docs/master;
git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.*" | tail -n +6 | xargs -I {} rm -rf {};
for tag in $(echo "master"; git tag -l --sort=-v:refname | grep -e "\d\+\.\d\+.*" | head -6);
do
if [ -d "docs/$tag/data/documentation/firebladeecs" ]
then
echo "✅ Documentation for "$tag" already exists.";
else
echo "⏳ Generating documentation for FirebladeECS @ "$tag" release.";
rm -rf "docs/$tag";
git checkout .;
git checkout "$tag";
DOCC_JSON_PRETTYPRINT=YES \
swift package \
--allow-writing-to-directory docs/"$tag" \
generate-documentation \
--fallback-bundle-identifier com.github.fireblade-engine.FirebladeECS \
--target FirebladeECS \
--output-path docs/"$tag" \
--transform-for-static-hosting \
--hosting-base-path ecs/"$tag" \
&& echo "✅ Documentation generated for FirebladeECS @ "$tag" release." \
|| echo "⚠️ Documentation skipped for FirebladeECS @ "$tag".";
fi;
done
- name: Fix permissions
run: 'sudo chown -R $USER docs'
- name: Publish documentation to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs
single-commit: true