-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (63 loc) · 2.35 KB
/
docc.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
# Name your workflow.
name: Deploy Gravatar DocC
on:
# Runs on pushes and PRs targeting the default branch
push:
branches: [ "trunk" ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
env:
GRAVATAR_URL: "gravatar"
GRAVATAR_UI_URL: "gravatarui"
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
# Must be set to this for deploying to GitHub Pages
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: macos-15
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Switch Xcode 🔄
run: sudo xcode-select --switch /Applications/Xcode_16.1.app
- name: Prepare Site
run: |
mkdir -p ./_site/$GRAVATAR_URL;
mkdir -p ./_site/$GRAVATAR_UI_URL;
- name: Build Gravatar SDK DocC Archives
run: |
xcodebuild docbuild -scheme Gravatar-Package \
-derivedDataPath /tmp/docbuild \
-destination 'generic/platform=iOS' \
-skipPackagePluginValidation;
- name: Process Gravatar DocC
run: |
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/Gravatar.doccarchive \
--hosting-base-path /Gravatar-SDK-iOS/$GRAVATAR_URL \
--output-path ./_site/$GRAVATAR_URL;
echo "<script>window.location.href += \"documentation/gravatar\"</script>" > ./_site/$GRAVATAR_URL/index.html;
- name: Process GravatarUI DocC
run: |
$(xcrun --find docc) process-archive \
transform-for-static-hosting /tmp/docbuild/Build/Products/Debug-iphoneos/GravatarUI.doccarchive \
--hosting-base-path /Gravatar-SDK-iOS/$GRAVATAR_UI_URL \
--output-path ./_site/$GRAVATAR_UI_URL;
echo "<script>window.location.href += \"documentation/gravatarui\"</script>" > ./_site/$GRAVATAR_UI_URL/index.html;
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload only docs directory
path: '_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4