forked from foxglove/mcap
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (108 loc) · 3.14 KB
/
website.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Website
on:
push:
branches: [main]
pull_request:
branches: ["*"]
jobs:
docs-home:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: true
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.x
cache: yarn
- run: yarn install --immutable
- run: yarn workspace website lint:ci
- run: yarn workspace website typecheck
- run: yarn workspace website build
- run: yarn typedoc --out website/build/docs/typescript
- uses: actions/upload-artifact@v4
with:
name: public
path: website/build
retention-days: 1
docs-cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make -C cpp ci-docs
- run: tar -czf docs-cpp.tgz __docs__/cpp
- uses: actions/upload-artifact@v4
with:
name: docs-cpp
path: docs-cpp.tgz
retention-days: 1
docs-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install pipenv
- run: make -C python docs
- run: tar -czf docs-python.tgz __docs__/python
- uses: actions/upload-artifact@v4
with:
name: docs-python
path: docs-python.tgz
retention-days: 1
docs-swift:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: swift-actions/setup-swift@v2
with:
swift-version: "5.7"
- run: mkdir __docs__
- run: |
swift package \
--allow-writing-to-directory __docs__ \
generate-documentation --target MCAP \
--output-path __docs__/swift \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path docs/swift
# https://github.com/actions/upload-artifact/issues/85
- run: tar -czf docs-swift.tgz __docs__/swift
- uses: actions/upload-artifact@v4
with:
name: docs-swift
path: docs-swift.tgz
retention-days: 1
docs-deploy:
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork && github.actor != 'dependabot[bot]' }}
needs:
- docs-home
- docs-cpp
- docs-python
- docs-swift
permissions:
contents: read
deployments: write
steps:
# need checkout so that cloudflare can detect git commit
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
- name: Extract API docs
run: |
for f in docs-*/*.tgz; do
(set -x; tar -xf $f)
done
mkdir -p public/docs
mv -v __docs__/* public/docs
- name: Deploy
uses: cloudflare/pages-action@v1
with:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
gitHubToken: ${{ github.token }}
branch: ${{ github.head_ref || github.ref_name }}
projectName: mcap
directory: public