diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f1a03e5f..99fca049 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,7 +6,7 @@ on: - main # Triggers the workflow on push events to the main branch pull_request: # Triggers the workflow on pull request events for any branch - types: [ opened, synchronize, reopened ] + types: [opened, synchronize, reopened] permissions: contents: write @@ -23,12 +23,14 @@ jobs: - name: Sphinx build run: | sphinx-build docs -b dirhtml _build - echo "burr.dagworks.io" > _build/CNAME # keep the cname file which this clobbers -- todo, unhardcode + - name: Set CNAME for main branch + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + run: echo "burr.dagworks.io" > _build/CNAME - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} with: - publish_branch: gh-pages + publish_branch: | + ${{ github.event_name == 'pull_request' && 'pr-' + github.event.pull_request.number || 'gh-pages' }} github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: _build/ force_orphan: true