adds federated dataset schema #187
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |