Skip to content

Commit 9b81640

Browse files
add diffs to pr_deploy
1 parent afee7ea commit 9b81640

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/deploy_pr_preview.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,34 @@ jobs:
4444
destination_dir: pull${{ github.event.number }}
4545
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews
4646

47+
- name: Checkout the gh-pages branch
48+
uses: actions/checkout@v2
49+
with:
50+
fetch-depth: '0'
51+
ref: 'gh-pages'
52+
53+
- name: Run website diff
54+
run: |
55+
rustup update
56+
pip install website_diff
57+
website_diff --old dev --new pull${{ github.event.number }} --diff diff${{ github.event.number }}
58+
59+
- name: GitHub Pages action to push diff
60+
uses: peaceiris/[email protected]
61+
with:
62+
github_token: ${{ secrets.GITHUB_TOKEN }}
63+
publish_dir: diff${{ github.event.number }}
64+
keep_files: true
65+
destination_dir: diff${{ github.event.number }}
66+
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews
67+
68+
4769
- name: Post URLS to PR thread
4870
uses: mshick/[email protected]
4971
with:
5072
message: |
5173
Hello! I've built a preview of your PR so that you can compare it to the current `main` branch.
5274
* PR deploy preview available [here](https://python.datasciencebook.ca/pull${{ github.event.number }}/index.html)
75+
* PR diff with `main` available [here](https://python.datasciencebook.ca/diff${{ github.event.number }}/index.html)
5376
* Current `main` deploy preview available [here](https://python.datasciencebook.ca/dev/index.html)
5477
* Public production build available [here](https://python.datasciencebook.ca)

0 commit comments

Comments
 (0)