-
Notifications
You must be signed in to change notification settings - Fork 15
70 lines (62 loc) · 2.24 KB
/
documentation-ghpages.yaml
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
name: Deploy Documentation
on:
push:
branches:
- master
tags:
- '*'
env:
DEVELOPER_DIR: /Applications/Xcode_14.2.app/Contents/Developer
NSUnbufferedIO: YES
# NOTE: The DocC `generate-documentation` plugin does not handle the
# hostingBasePath well. In particular, it doesn't properly handle
# multiple child paths. Furthermore, the current 1.0.0 version of
# the plugin doesn't handle updates to the index.html or *.js
# files.
#
# This workflow should be revisited once Xcode 14 GA is released
# so the newer DocC utilities can be utilized.
jobs:
ExportToGHPages:
name: Export to Github Pages
runs-on: macos-12
steps:
- uses: actions/checkout@master
- name: Prepare directory
run: |
mkdir -p .build/symbol-graphs
- name: Build Symbol Graphs
run: |
swift build \
--target OktaIdx \
-Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph -Xswiftc -emit-symbol-graph-dir -Xswiftc .build/symbol-graphs
- name: Generate Documentation
run: |
set +e
VERSION=$(git describe --tags 2>/dev/null)
if [[ $? -ne 0 ]]; then
VERSION=development
fi
set -e
export DOCC_JSON_PRETTYPRINT=YES
xcrun docc convert \
Sources/OktaIdx/OktaIdx.docc \
--enable-inherited-docs \
--output-path OktaIdx.doccarchive \
--fallback-display-name OktaIdx \
--fallback-bundle-identifier com.okta.mobile.oktaidx \
--fallback-bundle-version $VERSION \
--additional-symbol-graph-dir .build/symbol-graphs
mkdir -p docs/$VERSION
$(xcrun --find docc) process-archive transform-for-static-hosting \
OktaIdx.doccarchive \
--hosting-base-path okta-idx-swift/$VERSION/oktaidx \
--output-path docs/$VERSION/oktaidx
sed -I -e "s#<head>#<head><meta http-equiv='refresh' content='0;url=./documentation/oktaidx/'>#" \
docs/$VERSION/oktaidx/index.html
- name: Deploy documentation to Github Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
keep_files: true