-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (48 loc) · 1.73 KB
/
generate-markdown.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
name: generate-markdown
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
workflow_dispatch:
jobs:
generate-markdown:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Convert Dataset Yaml to JSON
run: ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' < schema/dataset/latest/dataset.schema.yaml > schema/dataset/latest/dataset.schema.json
- name: Set up NodeJS
uses: actions/setup-node@v1
with:
node-version: '13.x'
# Run Spectral on latest schemas
- uses: stoplightio/spectral-action@v0.5.5
with:
file_glob: 'schema/*/latest/*.yaml'
- name: Install jsonschema2md package
run: npm install -g @adobe/jsonschema2md@6.1.4
- name: Run jsonschema2md package to generate markdown
run: jsonschema2md -n -d schema/dataset/latest -o docs/dataset/latest -x -
- name: Install jsonschema-for-humans
run: pip install json-schema-for-humans
- name: Install jsonschema-for-humans
run: generate-schema-doc schema/dataset/latest/dataset.schema.json schema/dataset/latest/index.html
- name: Auto-Commit generate-markdown
uses: stefanzweifel/git-auto-commit-action@v4.1.6
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
with:
commit_message: Commit generated markdown
branch: ${{ github.head_ref }}
commit_user_name: Susheel Varma
commit_user_email: susheel.varma@hdruk.ac.uk
commit_author: Susheel Varma <susheel.varma@hdruk.ac.uk>