data-models-update #179
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: Documentation Generator | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: [data-models-update] | |
push: | |
branches: [ master ] | |
jobs: | |
documentation-generator: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout master branch | |
uses: actions/checkout@v2 | |
- name: Identify | |
run: | | |
git config user.name OpenActive Bot | |
git config user.email [email protected] | |
- name: Use Node.js 14.x | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14.x | |
- name: Erase existing docs except README.md | |
run: find ./docs/data-model/types -type f -maxdepth 1 ! -name README.md -delete | |
- run: npm install | |
working-directory: generator | |
- name: Update data models | |
run: | | |
npm install @openactive/data-models@latest | |
npm ls @openactive/data-models | |
working-directory: generator | |
- name: Generate data model documentation | |
run: npm start | |
working-directory: generator | |
- name: Commit generated files | |
run: | | |
git add docs/data-model/types/ | |
git add docs/SUMMARY.md | |
git status | |
git commit --message "Updating auto-generated model documentation [ci skip]" || echo "No changes to commit" | |
- name: Push generated files | |
run: git push |