diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6744d92..37800a2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,6 +37,9 @@ jobs: # Add a dependency to the build job needs: build + # Deploy only after a push to the main branch. + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment permissions: pages: write # to deploy to Pages @@ -50,9 +53,6 @@ jobs: # Specify runner + deployment step runs-on: ubuntu-latest - # Shouldn't run when the PR comes from a fork - if: ${{ !github.event.pull_request.head.repo.fork }} - steps: - name: Deploy to GitHub Pages id: deployment