Merge pull request #124 from VectorInstitute/pre-commit-ci-update-config #106
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: docs | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - .pre-commit-config.yaml | |
| - .github/workflows/docs.yml | |
| - '**.py' | |
| - '**.ipynb' | |
| - '**.html' | |
| - '**.js' | |
| - '**.md' | |
| - uv.lock | |
| - pyproject.toml | |
| - mkdocs.yml | |
| - '**.png' | |
| - '**.svg' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - .pre-commit-config.yaml | |
| - .github/workflows/docs.yml | |
| - '**.py' | |
| - '**.ipynb' | |
| - '**.js' | |
| - '**.html' | |
| - uv.lock | |
| - pyproject.toml | |
| - '**.md' | |
| - mkdocs.yml | |
| - '**.png' | |
| - '**.svg' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/[email protected] | |
| - name: Install uv | |
| uses: astral-sh/[email protected] | |
| with: | |
| version: "0.5.21" | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/[email protected] | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Install the project | |
| run: uv sync --all-extras --group docs | |
| - name: Build docs | |
| run: uv run mkdocs build | |
| - name: Create .nojekyll file | |
| run: touch site/.nojekyll | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: docs-site | |
| path: site/ | |
| retention-days: 1 | |
| deploy: | |
| needs: build | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/[email protected] | |
| - name: Configure Git Credentials | |
| run: | | |
| git config user.name github-actions[bot] | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| - name: Download artifact | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: docs-site | |
| path: site | |
| - name: Ensure .nojekyll exists | |
| run: touch site/.nojekyll | |
| - name: Deploy to Github pages | |
| uses: JamesIves/[email protected] | |
| with: | |
| branch: gh-pages | |
| folder: site |