feat: add JSON schemas for release v1.0.0 (#125) #178
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: Build and Deploy Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: | |
| - opened | |
| - reopened | |
| - synchronize | |
| jobs: | |
| build-docs: | |
| if: false # Temporarily disabled - skip documentation build | |
| runs-on: ubuntu-latest | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| contents: write # to let mkdocs write the new docs | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
| - name: Set up Python. | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Install Poetry. | |
| run: pipx install poetry | |
| - name: Install dependencies. | |
| run: poetry install -E docs | |
| - name: Clean docs directory | |
| run: | | |
| # Backup static files | |
| mkdir -p docs_backup | |
| cp docs/index.md docs_backup/ || true | |
| cp docs/quickstart.md docs_backup/ || true | |
| cp docs/development.md docs_backup/ || true | |
| cp docs/about.md docs_backup/ || true | |
| # Clean generated content | |
| rm -rf docs/* | |
| rm -rf site/ | |
| # Restore static files | |
| cp docs_backup/* docs/ || true | |
| rm -rf docs_backup | |
| - name: Generate documentation. | |
| run: | | |
| mkdir -p docs | |
| touch docs/.nojekyll | |
| # Run the Python script to generate documentation | |
| poetry run python scripts/generate_docs.py | |
| # Commit the generated files | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add docs/ | |
| git commit -m "docs: update generated documentation" || true | |
| git push || true | |
| - name: Build documentation. | |
| run: | | |
| # Build the documentation using Poetry | |
| poetry run mkdocs build | |
| # Verify the build | |
| ls -la site/ | |
| cat site/index.html | |
| deploy-docs: | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python. | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Install Poetry. | |
| run: pipx install poetry | |
| - name: Install dependencies. | |
| run: poetry install -E docs | |
| - name: Deploy to GitHub Pages | |
| run: poetry run mkdocs gh-deploy --force | |
| preview-docs: | |
| if: github.event_name == 'pull_request' | |
| needs: build-docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python. | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Install Poetry. | |
| run: pipx install poetry | |
| - name: Install dependencies. | |
| run: poetry install -E docs | |
| - name: Clean docs directory | |
| run: | | |
| # Backup static files | |
| mkdir -p docs_backup | |
| cp docs/index.md docs_backup/ || true | |
| cp docs/quickstart.md docs_backup/ || true | |
| cp docs/development.md docs_backup/ || true | |
| cp docs/about.md docs_backup/ || true | |
| # Clean generated content | |
| rm -rf docs/* | |
| rm -rf site/ | |
| # Restore static files | |
| cp docs_backup/* docs/ || true | |
| rm -rf docs_backup | |
| - name: Generate documentation. | |
| run: | | |
| mkdir -p docs | |
| touch docs/.nojekyll | |
| # Run the Python script to generate documentation | |
| poetry run python scripts/generate_docs.py | |
| # Commit the generated files | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add docs/ | |
| git commit -m "docs: update generated documentation" || true | |
| git push || true | |
| - name: Build documentation. | |
| run: | | |
| # Build the documentation using Poetry | |
| poetry run mkdocs build | |
| # Verify the build | |
| ls -la site/ | |
| cat site/index.html | |
| - name: Deploy preview | |
| uses: rossjrw/pr-preview-action@v1 | |
| with: | |
| source-dir: site/ | |
| preview-branch: gh-pages |