Skip to content

Commit 3f7b056

Browse files
authored
Update GitHub Actions workflow for DocC build (#23)
1 parent 9471103 commit 3f7b056

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

.github/workflows/docc.yml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,57 @@
11
name: docc
2+
23
on:
34
push:
45
branches: [ "main" ]
6+
57
permissions:
68
contents: read
79
pages: write
810
id-token: write
11+
912
concurrency:
1013
group: pages
1114
cancel-in-progress: true
15+
1216
jobs:
1317
pages:
1418
environment:
1519
name: github-pages
1620
url: '${{ steps.deployment.outputs.page_url }}'
1721
runs-on: macos-latest
22+
1823
steps:
19-
- uses: swift-actions/setup-swift@v1
20-
- name: git checkout
24+
- name: Checkout code
2125
uses: actions/checkout@v3
22-
- name: docbuild
23-
run: >
24-
sudo xcode-select -s /Applications/Xcode_16.0.app;
25-
xcodebuild docbuild -scheme Cache \
26-
-derivedDataPath /tmp/docbuild \
27-
-destination 'generic/platform=iOS';
28-
$(xcrun --find docc) process-archive \
29-
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/Cache.doccarchive \
26+
27+
- name: Setup Xcode
28+
uses: maxim-lobanov/setup-xcode@v1
29+
with:
30+
xcode-version: 16.0
31+
32+
- name: Set up Swift
33+
uses: swift-actions/setup-swift@v2
34+
with:
35+
swift-version: '6.1.0'
36+
37+
- name: Build and Export DocC
38+
run: |
39+
swift package --allow-writing-to-directory docs \
40+
generate-documentation --target Cache \
3041
--output-path docs \
31-
--hosting-base-path 'Cache';
32-
echo "<script>window.location.href +=
33-
\"/documentation/cache\"</script>" > docs/index.html;
34-
- name: artifacts
35-
uses: actions/upload-pages-artifact@v1
42+
--transform-for-static-hosting \
43+
--hosting-base-path Cache
44+
45+
echo '<script>window.location.href += "/documentation/cache"</script>' > docs/index.html
46+
47+
- name: Configure Pages
48+
uses: actions/configure-pages@v5
49+
50+
- name: Upload Pages artifact
51+
uses: actions/upload-pages-artifact@v3
3652
with:
3753
path: docs
38-
- name: deploy
54+
55+
- name: Deploy to GitHub Pages
3956
id: deployment
40-
uses: actions/deploy-pages@v1
57+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)