-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (55 loc) · 2.15 KB
/
schemas-doc-generator.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
name: schemas-doc-generator
on:
pull_request:
push:
branches: [main]
jobs:
json-schema-validation:
runs-on: ubuntu-latest
name: JSON Schema validation through pre-commit
steps:
- uses: actions/checkout@v3
- uses: pre-commit/[email protected]
with:
extra_args: --all -c .pre-commit-config.yaml jsonschema_dir_validate
update_docs:
runs-on: ubuntu-latest
name: Update documentation if all worked properly
needs:
- json-schema-validation
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 100
- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip'
architecture: x64
cache-dependency-path: 'dev-requirements.txt'
- name: Install documentation generator dependencies (development)
run: |
pip install -r dev-requirements.txt
- name: Generate HTML documentation from internal JSON Schemas
id: doc-generate-html-if-changed
run: |
development-scripts/regenerate_schema_docs_html.bash wfexs_backend/schemas development-docs/schemas
- name: Generate MD documentation from internal JSON Schemas
id: doc-generate-md-if-changed
run: |
development-scripts/regenerate_schema_docs_md.bash wfexs_backend/schemas development-docs/schemas
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
if: steps.doc-generate-md-if-changed.outcome == 'success' || steps.doc-generate-html-if-changed.outcome == 'success'
with:
title: Updated schemas documentation (triggered by ${{ github.sha }})
branch: create-pull-request/patch-schema-docs
delete-branch: true
commit-message: "[create-pull-request] Automatically commit updated contents (generated schemas documentation)"
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"