-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds publish of docs for non-main-branch
This way we can test it out/share
- Loading branch information
1 parent
d6f58f6
commit 358d8d2
Showing
7 changed files
with
608 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,20 @@ 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 | ||
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 | ||
|
@@ -24,6 +30,15 @@ jobs: | |
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: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
|
@@ -32,3 +47,19 @@ jobs: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/ | ||
force_orphan: true | ||
- 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: 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 }}/" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Enable line wrapping for code blocks */ | ||
.highlight pre { | ||
white-space: pre-wrap; | ||
word-wrap: break-word; | ||
} |
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
Oops, something went wrong.