-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 1.83 KB
/
build-deploy-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
name: Build and Deploy Docs
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build-docs:
name: Build Docs
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode Version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.1.0'
- name: Build Docs
env:
workspace: RxNetworkKit.xcworkspace
scheme: RxNetworkKit
run: |
xcodebuild docbuild -workspace "${workspace}" -scheme "${scheme}" -derivedDataPath derivedData | xcpretty
mkdir docArchives
cp -R `find derivedData -type d -name "*.doccarchive"` docArchives
zip -r RxNetworkKitDocCArchive.zip docArchives/RxNetworkKit.doccarchive
- name: Upload Docs Archive
uses: actions/upload-artifact@v3
with:
name: doc-archive-zip
path: RxNetworkKitDocCArchive.zip
deploy-docs:
name: Deploy Docs
runs-on: macos-13
needs: build-docs
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Docs Archive
uses: actions/download-artifact@v3
with:
name: doc-archive-zip
- name: Perpare Docs for Deployment
run: |
unzip RxNetworkKitDocCArchive.zip
$(xcrun --find docc) process-archive transform-for-static-hosting docArchives/RxNetworkKit.doccarchive --hosting-base-path RxNetworkKit --output-path docs
echo "<script>window.location.href += \"/documentation/rxnetworkkit\"</script>" > docs/index.html;
- name: Upload Docs artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'docs'
- name: Deploy Docs artifact
id: deployment
uses: actions/deploy-pages@v1