Skip to content

Commit e0cdf14

Browse files
Add docs deploy flow
Signed-off-by: Marquis Kurt <software@marquiskurt.net>
1 parent f0c5e7f commit e0cdf14

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

.github/workflows/docs-build.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: DocC Runner
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# Allow one concurrent deployment
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: true
17+
18+
# A single job that builds and deploys the DocC documentation
19+
jobs:
20+
deploy:
21+
environment:
22+
name: github-pages
23+
url: ${{ steps.deployment.outputs.page_url }}
24+
runs-on: macos-14
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v4
30+
- name: Select Xcode
31+
uses: maxim-lobanov/setup-xcode@v1
32+
with:
33+
xcode-version: '16.2.0'
34+
- name: Build DocC
35+
run: |
36+
swift package resolve;
37+
38+
xcodebuild docbuild -scheme Alidade -derivedDataPath /tmp/docbuild -destination 'generic/platform=iOS';
39+
40+
$(xcrun --find docc) process-archive \
41+
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/Alidade.doccarchive \
42+
--output-path docs \
43+
--hosting-base-path 'Alidade';
44+
45+
echo "<script>window.location.href += \"/documentation/alidade\"</script>" > docs/index.html;
46+
- name: Upload artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: 'docs'
50+
- id: deployment
51+
name: Deploy to GitHub Pages
52+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)