Merge pull request #114 from zephyr-data-specs/main #51
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 GMNS Documentation and DB | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
permissions: | |
contents: write | |
pull-requests: write | |
env: | |
BASE_BRANCH: main | |
SPEC_FOLDER: spec | |
SCRIPTS_FOLDER: scripts | |
DOCS_FOLDER: docs/spec | |
jobs: | |
update-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: technote-space/get-diff-action@v6 | |
id: getDiff | |
with: | |
PATTERNS: | | |
${{env.SPEC_FOLDER}}/* | |
- uses: actions/setup-python@v5 | |
if: steps.getDiff.outputs.diff | |
with: | |
python-version: "3.12" | |
cache: 'pip' | |
- name: Install requirements | |
run: pip install -r ${{env.SCRIPTS_FOLDER}}/requirements.txt | |
if: steps.getDiff.outputs.diff | |
- name: Run schema generator | |
if: steps.getDiff.outputs.diff | |
run: python ${{env.SCRIPTS_FOLDER}}/generate.py | |
- name: Create Pull Request | |
id: create_pr | |
if: steps.getDiff.outputs.diff | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
commit-message: Update documentation | |
title: "Update Spec Documentation" | |
branch: autogenerated-docs | |
body: "Automated changes. This GitHub action is in beta." | |
base: ${{ github.ref_name }} | |
delete-branch: true |