Skip to content

Commit 846ceea

Browse files
Merge pull request #43 from UBC-DSCI/dev
update main
2 parents ee27769 + 6590225 commit 846ceea

File tree

7 files changed

+48
-24
lines changed

7 files changed

+48
-24
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source/** @UBC-DSCI/dsci-100-instructors

.github/workflows/build_book.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Rebuild and deploy book to gh-pages branch
12
on:
23
push:
34
branches:
@@ -7,36 +8,20 @@ on:
78

89
jobs:
910
deploy-book:
10-
runs-on: ${{ matrix.os }}
11+
runs-on: ubuntu-latest
1112
permissions:
1213
contents: write
1314
packages: write
1415

15-
strategy:
16-
fail-fast: false
17-
matrix:
18-
include:
19-
- os: ubuntu-latest
20-
lock-file: conda-linux-64.lock
21-
os: [ubuntu-latest]
22-
defaults:
23-
run:
24-
shell: bash -l {0}
2516
steps:
2617
- name: checkout
2718
uses: actions/checkout@v2
2819
with:
2920
ref: 'main'
3021

31-
- name: install from lockfile
32-
uses: mamba-org/provision-with-micromamba@main
33-
with:
34-
environment-name: lock_test
35-
environment-file: .github/workflows/lockfiles/${{ matrix.lock-file }}
36-
3722
- name: Build the book
3823
run: |
39-
jupyter-book build source
24+
./build_html.sh
4025
4126
# Push the book's HTML to github-pages
4227
- name: GitHub Pages action
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Rebuild and publish new ubcdsci/py-intro-to-ds image on DockerHub
2+
on:
3+
push:
4+
branches:
5+
- dev
6+
paths:
7+
- Dockerfile
8+
jobs:
9+
rebuild-docker:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- name: Checkout dev
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: '0'
18+
ref: 'dev'
19+
- name: Rebuild and publish image
20+
id: rebuild
21+
uses: elgohr/Publish-Docker-Github-Action@v5
22+
with:
23+
name: ubcdsci/py-intro-to-ds
24+
username: ${{ secrets.DOCKER_USERNAME }}
25+
password: ${{ secrets.DOCKER_PASSWORD }}
26+
dockerfile: Dockerfile
27+
snapshot: true
28+
- name: Update build_html.sh script
29+
run: |
30+
git config --local user.email "[email protected]"
31+
git config --local user.name "GitHub Action"
32+
git pull origin dev
33+
sed 's/ubcdsci\/py-intro-to-ds:[[:alnum:]]\+/ubcdsci\/py-intro-to-ds:${{ steps.rebuild.outputs.snapshot-tag }}/g' build_html.sh > build_html.tmp && mv build_html.tmp build_html.sh
34+
git add build_html.sh
35+
git commit -m "update build_html.sh script with new docker image"
36+
- name: Push changes to build scripts
37+
uses: ad-m/github-push-action@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
branch: 'dev'

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Dockerfile for intro to ds python book
12
FROM jupyter/scipy-notebook
23

34
USER root
@@ -20,7 +21,6 @@ RUN mamba install --quiet --yes \
2021
'click' \
2122
'ghp-import' \
2223
'jupytext' \
23-
'jupyter_contrib_nbextensions' \
2424
'jupyter-book' \
2525
'nodejs' \
2626
&& mamba clean --all -f -y \

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ See [the license file](LICENSE.md) for more information.
1414

1515
### Setup
1616

17-
In order to build the book, you need to first install Docker
18-
(instructions here: [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)).
17+
Building the book requires Docker (instructions here: [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)).
1918

2019
### Contributing
2120
Primary development in this repository happens on the `dev` branch. If you want to contribute to the book,
@@ -35,7 +34,7 @@ in the root directory of this repository. The book can be viewed in your browser
3534

3635
You can update the build environment for the book by making changes to `Dockerfile` in the root of the repository in the `dev` branch.
3736
If you push any changes to the `Dockerfile` on the `dev` branch, GitHub will trigger a rebuild of the docker image,
38-
push it to DockerHub, and update the `build_html.sh` script and book deploy GitHub action with the new image digest.
37+
push it to DockerHub, and update the `build_html.sh` script and book deploy GitHub action with the new image tag.
3938

4039
### Update public html
4140

build_html.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run --rm -v $(pwd):/home/jovyan ubcdsci/py-intro-to-ds:202212112047457751d4 /bin/bash -c "jupyter-book build source"

push_html.sh

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)