Feat json schema (#1) #3
This file contains hidden or 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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| pages: write | |
| id-token: write | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip install check-jsonschema | |
| - name: Validate examples | |
| run: check-jsonschema --schemafile schema.json examples/*/data.json | |
| deploy: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: validate | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip install json-schema-for-humans | |
| - name: Build site | |
| run: | | |
| mkdir build | |
| generate-schema-doc schema.json build/index.html | |
| cp schema.json build/ | |
| cp -r examples/*/ build/ | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: build/ | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |