diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index dc7310be..47ee7e5b 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -2,6 +2,8 @@ name: "Deploy Docs" on: push: branches: [main] + pull_request: + branches: [main] defaults: run: @@ -10,7 +12,7 @@ defaults: jobs: # https://github.com/marketplace/actions/deploy-to-github-pages build-docs-deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest env: TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html" steps: @@ -23,7 +25,8 @@ jobs: - name: Set up Python 🐍 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10" + cache: "pip" # Note: This uses an internal pip API and may not always work # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow @@ -56,6 +59,7 @@ jobs: - name: Deploy 🚀 uses: JamesIves/github-pages-deploy-action@v4.7.1 + if: github.ref == 'refs/heads/main' with: token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages # The branch the action should deploy to. @@ -63,4 +67,3 @@ jobs: clean: true # Automatically remove deleted files from the deploy branch target-folder: docs # If you'd like to push the contents of the deployment folder into a specific directory single-commit: true # you'd prefer to have a single commit on the deployment branch instead of full history - if: success()