-
-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (70 loc) · 2.17 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
name: Generate docs
on:
push:
branches:
- "main"
- "docs"
workflow_dispatch:
jobs:
deploy-docs:
runs-on: "ubuntu-latest"
name: "Generate docs"
steps:
- uses: actions/checkout@v3
with:
ref: docs
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v3
name: "Cache Python dependencies (mkdocs-material and mike)"
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Add git user for mike
run: |
git config --global user.name GitHub Actions
git config --global user.email [email protected]
- name: "Deploy documentation"
run: mike deploy v0.11.0 latest -u --push
deploy-api-docs:
needs: deploy-docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: latest
- name: Cache Shards
uses: actions/cache@v3
with:
path: ./lib
key: shards-${{ hashFiles('shard.lock') }}
- name: Install Shards
run: |
if ! shards check; then
shards install
fi
- name: Build API docs
run: |
crystal docs --output=api --project-name=Rosetta \
--canonical-base-url="https://wout.github.io/rosetta/api/latest" --source-url-pattern="https://github.com/wout/rosetta/blob/%{refname}/%{path}#L%{line}" \
--source-refname=${GITHUB_SHA::8}
- name: Deploy API docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: api
target-folder: api/main
clean: false