-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #354 from UBC-DSCI/main
Update public website
- Loading branch information
Showing
11 changed files
with
108 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -15,6 +15,13 @@ jobs: | |
packages: write | ||
|
||
steps: | ||
- name: Get Actions user id | ||
id: get_uid | ||
run: | | ||
actions_user_id=`id -u $USER` | ||
echo $actions_user_id | ||
echo "uid=$actions_user_id" >> $GITHUB_OUTPUT | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
|
@@ -24,6 +31,11 @@ jobs: | |
run: | | ||
./build_html.sh | ||
- name: Reset ownership of workspace after build | ||
uses: peter-murray/reset-workspace-ownership-action@v1 | ||
with: | ||
user_id: ${{ steps.get_uid.outputs.uid }} | ||
|
||
# Push the book's HTML to github-pages | ||
- name: GitHub Pages action | ||
uses: peaceiris/[email protected] | ||
|
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 |
---|---|---|
|
@@ -23,7 +23,14 @@ jobs: | |
checkName: "Rebuild docker image" | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
timeoutSeconds: 60000 | ||
|
||
|
||
- name: Get Actions user id | ||
id: get_uid | ||
run: | | ||
actions_user_id=`id -u $USER` | ||
echo $actions_user_id | ||
echo "uid=$actions_user_id" >> $GITHUB_OUTPUT | ||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
with: | ||
|
@@ -34,6 +41,11 @@ jobs: | |
run: | | ||
./build_html.sh | ||
- name: Reset ownership of workspace after build | ||
uses: peter-murray/reset-workspace-ownership-action@v1 | ||
with: | ||
user_id: ${{ steps.get_uid.outputs.uid }} | ||
|
||
# Push the book's HTML to github-pages | ||
- name: GitHub Pages action | ||
uses: peaceiris/[email protected] | ||
|
@@ -44,11 +56,35 @@ jobs: | |
destination_dir: pull${{ github.event.number }} | ||
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews | ||
|
||
- name: Checkout the gh-pages branch | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
ref: 'gh-pages' | ||
|
||
- name: Run website diff | ||
run: | | ||
rustup update | ||
pip install --upgrade pip | ||
pip install website_diff | ||
rm -rf diff${{ github.event.number }} | ||
website_diff --old dev --new pull${{ github.event.number }} --diff diff${{ github.event.number }} | ||
- name: GitHub Pages action to push diff | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: diff${{ github.event.number }} | ||
keep_files: true | ||
destination_dir: diff${{ github.event.number }} | ||
# force_orphan: true # once peaceiris updates to v4, change this to true and keep_files: true for the PR / main branch deploy previews | ||
|
||
- name: Post URLS to PR thread | ||
uses: mshick/[email protected] | ||
with: | ||
message: | | ||
Hello! I've built a preview of your PR so that you can compare it to the current `main` branch. | ||
* PR deploy preview available [here](https://python.datasciencebook.ca/pull${{ github.event.number }}/index.html) | ||
* PR diff with `main` available [here](https://python.datasciencebook.ca/diff${{ github.event.number }}/index.html) | ||
* Current `main` deploy preview available [here](https://python.datasciencebook.ca/dev/index.html) | ||
* Public production build available [here](https://python.datasciencebook.ca) |
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,41 @@ | ||
name: Rebuild and deploy book to gh-pages branch | ||
on: | ||
push: | ||
branches: | ||
- production | ||
paths: | ||
- 'source/**' | ||
- 'build_html.sh' | ||
|
||
jobs: | ||
deploy-book: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
|
||
steps: | ||
- name: checkout gh-pages | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: 'gh-pages' | ||
|
||
- name: Copy contents of dev/ to home folder | ||
run: | | ||
yes | cp -rf dev ${{ runner.home }} | ||
# Push update website to dev/ and clean out old commits | ||
- name: Update website to contents of dev, remove all old commits and subpages | ||
uses: peaceiris/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: dev/ | ||
force_orphan: true # this will clean up all previous PR previews / main branch preview | ||
cname: datasciencebook.ca | ||
|
||
- name: copy dev/ website back in | ||
run: | | ||
yes | cp -rf ${{ runner.home }}/dev dev | ||
- name: push the result to gh-pages | ||
uses: stefanzweifel/git-auto-commit-action@v5 |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
chmod -R o+w source/ | ||
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:20231112004031dd2207 /bin/bash -c "jupyter-book build source" | ||
|
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
Binary file modified
BIN
-34.2 KB
(73%)
source/img/frontmatter/ds-a-first-intro-cover.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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