Generate docs #287
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
# This is a basic workflow to help you get started with Actions | |
name: Generate docs | |
on: | |
# Triggers on PRs to main | |
pull_request: | |
branches: | |
- main | |
# Triggers the workflow on push events for main and any fix/* feat/* branches | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' # daily end of day | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
lint: | |
name: Lint custom definition overwrite YAMLs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Lint custom_definitions/* | |
uses: ibiqlik/action-yamllint@v3 | |
with: | |
config_file: tools/yamllint.conf | |
file_or_dir: docs/custom_definitions | |
generate: | |
name: Generate docs from AMDR and Excel | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' | |
needs: lint | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.8" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r tools/requirements.txt | |
- name: Pull latest OpenAPI spec | |
run: curl -L https://dbs-api.emgora.eu/v1/emgamr/api/ -o tools/swagger.json || echo "::warning::Failed to grab latest OpenAPI Specification!!" | |
- name: Run postgrest-to-detail (generate fields listing) | |
run: python tools/postgrest-to-detail.py | |
- name: Commit any changes made | |
id: auto_commit | |
uses: stefanzweifel/git-auto-commit-action@v4.16.0 | |
with: | |
commit_message: ${{ ((github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && 'docs:fetch latest openapi spec [AUTO]') || github.event.head_commit.message }} [AUTO] | |
file_pattern: docs/attributes/*.md docs/attributes/*/*.md tools/swagger.json |