Parallelism example #1111
Workflow file for this run
This file contains 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: documentation | |
on: | |
push: | |
branches: | |
- 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] | |
permissions: | |
contents: write | |
pull-requests: write | |
concurrency: ci-${{ github.ref }} | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
PR_PATH: pull/${{github.event.number}} | |
BASE_URL: https://burr.dagworks.io/pull/${{github.event.number}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- name: Install dependencies | |
run: | | |
pip install -e ".[documentation]" | |
- 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: Comment on PR | |
uses: hasura/[email protected] | |
if: github.ref != 'refs/heads/main' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
number: ${{ github.event.number }} | |
id: deploy-preview | |
message: "Starting deployment of preview ⏳..." | |
- name: Build PR preview website | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref != 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/ | |
destination_dir: ${{ env.PR_PATH }} # TODO you need to set this if you're using a custom domain. Otherwise you can remove it. | |
- 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 | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: _build/ | |
keep_files: true # Add this line to keep existing files in the gh-pages branch | |
- name: Update comment | |
uses: hasura/[email protected] | |
if: github.ref != 'refs/heads/main' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
number: ${{ github.event.number }} | |
id: deploy-preview | |
message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n ✨ ${{ env.BASE_URL }} ✨\n\nChanges may take a few minutes to propagate. Since this is a preview of production, content with `draft: true` will not be rendered. The source is here: https://github.com/${{ github.repository }}/tree/gh-pages/${{ env.PR_PATH }}/" |