-
-
Notifications
You must be signed in to change notification settings - Fork 46
99 lines (84 loc) · 2.14 KB
/
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
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
name: Publish Docs
on:
push:
paths:
- docs/**
- src/**
- mkdocs.yml
branches: [main]
# Allow manual trigger (workflow_dispatch)
workflow_dispatch:
permissions:
contents: write
jobs:
build_doxygen:
name: Build Doxygen Docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Doxygen
run: sudo apt-get update && sudo apt-get install -y doxygen
- name: Write cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}
- name: Build Doxygen Docs
run: |
cd docs
doxygen
build_openapi_json:
name: Build OpenAPI
runs-on: ubuntu-latest
container:
image: ghcr.io/hotosm/fmtm/backend:ci-main
options: --user root
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}
restore-keys: |
doc-build-
- name: Build OpenAPi JSON
run: |
chmod -R 777 .
gosu appuser python scripts/gen_openapi_json.py -o docs/openapi.json
publish_docs:
name: Publish Docs
runs-on: ubuntu-latest
container:
image: ghcr.io/hotosm/fmtm/backend:ci-main
options: --user root
needs: [build_doxygen, build_openapi_json]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Read cache
uses: actions/cache@v3
with:
path: |
.cache
docs/apidocs
docs/openapi.json
key: doc-build-${{ env.cache_id }}
restore-keys: |
doc-build-
- name: Install Git
run: |
apt-get update
apt-get install -y git --no-install-recommends
- name: Publish
run: |
chmod -R 777 .
gosu appuser mkdocs gh-deploy --force