Update Python setup action to v6.2.0 #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: Deploy MkDocs to Netlify | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v6.2.0 | |
| with: | |
| python-version: '3.x' | |
| cache: pip | |
| cache-dependency-path: requirements-docs.txt | |
| - name: Install dependencies | |
| run: pip install -r requirements-docs.txt | |
| - name: Generate MkDocs site | |
| run: | | |
| bash scripts/build_site.sh | |
| mkdocs build | |
| env: | |
| GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }} | |
| - name: Setup Node.js (for Netlify CLI) | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: lts/* | |
| - name: Install Netlify CLI | |
| run: npm install -g netlify-cli | |
| # Deploy preview for Pull Requests | |
| - name: Deploy preview to Netlify | |
| if: github.event_name == 'pull_request' | |
| run: netlify deploy --dir=site --message="PR ${{ github.event.number }} - Run ${{ github.run_number }}" | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
| # Deploy to Production for Main branch pushes | |
| - name: Deploy to Netlify Production | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| run: netlify deploy --prod --dir=site --message="Deploy Main - Run ${{ github.run_number }}" | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |