-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (54 loc) · 1.47 KB
/
publish-pages.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
name: Deploy DocC
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
permissions:
contents: write
# pages: write
# id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build:
runs-on: macos-12
strategy:
fail-fast: false
matrix:
include:
- target: "Flare"
base_path: "flare"
- target: "FlareUI"
base_path: "flareui"
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build DocC
shell: bash
run: |
mkdir ./docs;
swift build;
swift package \
--allow-writing-to-directory ./docs \
generate-documentation \
--target ${{ matrix.target }} \
--output-path ./docs/${{ matrix.base_path }} \
--transform-for-static-hosting \
--hosting-base-path flare/${{ matrix.base_path }};
- name: Commit and push generated documentation
run: |
cp -r ./docs/${{ matrix.base_path }} ./${{ matrix.base_path }}
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git switch gh-pages
git add ./${{ matrix.base_path }}
git commit -a -m "Generated ${{ matrix.target }} Swift DocC"
git push origin gh-pages