(cloud) Build and Deploy Docs #5
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: (cloud) Build and Deploy Docs | |
| on: | |
| release: | |
| types: [published] | |
| # creates a button | |
| workflow_dispatch: | |
| inputs: | |
| logLevel: | |
| description: "Log level" | |
| required: true | |
| default: "warning" | |
| type: choice | |
| options: | |
| - info | |
| - warning | |
| - debug | |
| jobs: | |
| build_doc: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Install requirements | |
| run: | | |
| python -m pip install pdoc | |
| python -m pip install -e . | |
| - name: Generate Docs | |
| run: | | |
| python -m pdoc src/liquid_engine -o docs/ | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: docs/ | |
| deploy_doc: | |
| needs: build_doc | |
| # only run if main branch | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: "${{ steps.deployment.outputs.page_url }}" | |
| steps: | |
| - id: deployment | |
| uses: actions/deploy-pages@v4 |