-
Notifications
You must be signed in to change notification settings - Fork 1
75 lines (63 loc) · 2.19 KB
/
deploy-docs.yaml
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
name: Auto-deployment of nmdc_submission_schema documentation and DH interface
on:
push:
branches: [ main ]
jobs:
build-docs:
# TODO: this should probably be split into separate build and deploy jobs to
# reduce privileged token exposure
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
- name: Set up Python 3.
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Poetry.
uses: snok/[email protected]
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install yq
env:
YQ_VERSION: v4.30.5
YQ_BINARY: yq_linux_amd64
run: |
mkdir -p $HOME/.local/bin
wget https://github.com/mikefarah/yq/releases/download/$YQ_VERSION/$YQ_BINARY.tar.gz -O - | tar xz && mv $YQ_BINARY $HOME/.local/bin/yq
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Python dependencies.
run: poetry install -E docs
- name: Install JavaScript dependencies.
working-directory: data_harmonizer
run: npm install
- name: Regenerate schema
run: |
make \
clean \
schema-clean \
src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml \
project/json/nmdc_submission_schema.json
- name: Build documentation.
run: |
poetry run gen-doc -d docs src/nmdc_submission_schema/schema/nmdc_submission_schema.yaml
cp src/docs/*md docs/
poetry run mkdocs build -d dist
- name: Build DataHarmonizer interface.
working-directory: data_harmonizer
run: |
npm run build -- --outDir ../dist/_playground --base /${{ github.event.repository.name }}/_playground/
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: dist
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1