Skip to content

Commit 8f5e933

Browse files
Merge pull request #264 from UBC-DSCI/web-scraping-api
Web scraping / API re-introduction
2 parents 2799c1e + 8173f41 commit 8f5e933

16 files changed

+10247
-642
lines changed

.github/workflows/update_build_environment.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ name: Rebuild and publish new ubcdsci/py-intro-to-ds image on DockerHub
22
on:
33
pull_request:
44
types: [opened, synchronize]
5-
paths:
6-
- Dockerfile
5+
76
jobs:
87
rebuild-docker:
98
name: Rebuild docker image
@@ -21,20 +20,15 @@ jobs:
2120
run: |
2221
echo "GitHub PR action type: ${{ github.event.action }}"
2322
echo "Checking if the PR modifies the Dockerfile"
24-
if [[ ${{ github.event.action }} == 'opened' ]]; then
25-
echo "PR just opened, and it edits the Dockerfile, so rebuilding the image."
26-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
23+
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
24+
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
25+
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
2726
else
28-
if git diff --quiet ${{ github.event.before }} ${{ github.event.after }} Dockerfile; then
29-
echo "PR synchronized, but Dockerfile was not edited. Not rebuilding the image."
30-
echo "stale_dockerfile=false" >> "$GITHUB_OUTPUT"
31-
else
32-
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
33-
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
34-
fi
27+
echo "PR synchronized, and Dockerfile was edited, so rebuilding the image."
28+
echo "stale_dockerfile=true" >> "$GITHUB_OUTPUT"
3529
fi
3630
- name: Rebuild and publish image
37-
if: ${{steps.check-stale.outputs.stale_dockerfile == true }}
31+
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}
3832
id: rebuild
3933
uses: elgohr/Publish-Docker-Github-Action@v5
4034
with:
@@ -44,7 +38,7 @@ jobs:
4438
dockerfile: Dockerfile
4539
snapshot: true
4640
- name: Update build_html.sh script
47-
if: ${{steps.check-stale.outputs.stale_dockerfile == true }}
41+
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}
4842
run: |
4943
git config --local user.email "[email protected]"
5044
git config --local user.name "GitHub Action"
@@ -54,7 +48,7 @@ jobs:
5448
git add build_html.sh
5549
git commit -m "update build_html.sh script with new docker image"
5650
- name: Update build_pdf.sh script
57-
if: ${{steps.check-stale.outputs.stale_dockerfile == true }}
51+
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}
5852
run: |
5953
git config --local user.email "[email protected]"
6054
git config --local user.name "GitHub Action"
@@ -64,7 +58,7 @@ jobs:
6458
git add build_pdf.sh
6559
git commit -m "update build_pdf.sh script with new docker image"
6660
- name: Push changes to build scripts
67-
if: ${{steps.check-stale.outputs.stale_dockerfile == true }}
61+
if: ${{ steps.check-stale.outputs.stale_dockerfile == 'true' }}
6862
uses: ad-m/github-push-action@master
6963
with:
7064
github_token: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN pip install docutils==0.17.1 # Need to pin docutils to an old version for no
1818
RUN pip install referencing
1919
RUN pip install jupyter-book
2020
# Pinning pandas until altair 5.1.2 to avoid future warning https://github.com/altair-viz/altair/issues/3181
21-
RUN pip install numpy jinja2 pandas"<2.1" altair">=5.1.1" "vegafusion[embed]" vl-convert-python">=0.13" click ibis-framework ghp-import jupytext nodejs
21+
RUN pip install numpy jinja2 pandas"<2.1" altair">=5.1.1" "vegafusion[embed]" vl-convert-python">=0.13" click ibis-framework ghp-import jupytext nodejs lxml
2222

2323
# forces scikit-learn to grab latest to avoid bug in 1.3.0 related to checking for c-contiguity breaking figures in classification 2. See https://github.com/scikit-learn/scikit-learn/pull/26772
2424
# TODO: remove this once scikit-learn 1.4.x or beyond releases and is incorporated into jupyter/scipy-notebook

build_html.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
chmod -R o+w source/
2-
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:20230913180510589822 /bin/bash -c "jupyter-book build source"
2+
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:20230923214301d47351 /bin/bash -c "jupyter-book build source"

build_pdf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
chmod -R o+w source/
2-
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:20230913180510589822 /bin/bash -c "export BOOK_BUILD_TYPE='PDF'; jupyter-book build source --builder pdflatex"
2+
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:20230923214301d47351 /bin/bash -c "export BOOK_BUILD_TYPE='PDF'; jupyter-book build source --builder pdflatex"

source/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ html:
4848
use_multitoc_numbering: true # Continuous numbering across parts/chapters
4949
extra_navbar: Powered by <a href="https://jupyterbook.org">Jupyter Book</a> # Will be displayed underneath the left navbar.
5050
extra_footer: "" # Will be displayed underneath the footer.
51-
google_analytics_id: "" # A GA id that can be used to track book views.
51+
google_analytics_id: "G-7XBFF4RSN2" # A GA id that can be used to track book views.
5252
home_page_in_navbar: true # Whether to include your home page in the left Navigation Bar
5353
baseurl: "" # The base URL where your book will be hosted. Used for creating image previews and social links. e.g.: https://mypage.com/mybook/
5454
comments:

0 commit comments

Comments
 (0)