My project currently has this GitHub Action configuration to automatically publish documentation from main
:
- name: Upload Cargo doc output to GitHub Pages
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
deploy:
name: Deploy to GitHub Pages
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
I’d like to support also publishing docs for each PR in a sub-directory (e.g., /pulls/123/
). IIUC, if I do that using this flow, I’ll end up clobbering the entire contents of the site, which I don’t want to do – I want the contents generated via the Action running on main
to remain. Is there any way to accomplish this?