generated from ANU-RSES-Education/self-managing-jupyterhub
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
44 additions
and
47 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 |
---|---|---|
|
@@ -4,7 +4,7 @@ name: test-build-book | |
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- master | ||
|
||
workflow_dispatch: | ||
|
||
|
@@ -20,64 +20,61 @@ jobs: | |
test-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
# Install dependencies | ||
# - name: Set up Python 3.7 | ||
# uses: actions/setup-python@v1 | ||
# with: | ||
# python-version: 3.7 | ||
|
||
- name: Cache book files | ||
uses: actions/cache@v1 | ||
env: | ||
# Increase this value to reset cache if etc/example-environment.yml has not changed | ||
CACHE_NUMBER: 1 | ||
with: | ||
path: | | ||
~/conda_pkgs_dir | ||
/usr/share/miniconda3/envs/jupyter | ||
~/.cache/pip | ||
~/Jupyterbook/_build | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda_packages.yml') }} | ||
# Install dependencies | ||
# - name: Set up Python 3.7 | ||
# uses: actions/setup-python@v1 | ||
# with: | ||
# python-version: 3.7 | ||
|
||
- name: Cache book files | ||
uses: actions/cache@v1 | ||
env: | ||
# Increase this value to reset cache if etc/example-environment.yml has not changed | ||
CACHE_NUMBER: 1 | ||
with: | ||
path: | | ||
~/conda_pkgs_dir | ||
/usr/share/miniconda3/envs/jupyter | ||
~/.cache/pip | ||
~/Jupyterbook/_build | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('conda_packages.yml') }} | ||
|
||
- name: switch base env name to something other than 'base' | ||
run: | | ||
sed 's/name: base/name: jupyter/' conda_packages.yml > conda_jupyter_env.yml | ||
- name: switch base env name to something other than 'base' | ||
run: | | ||
sed 's/name: base/name: jupyter/' conda_packages.yml > conda_jupyter_env.yml | ||
- name: Miniconda / Miniforge | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: latest | ||
- name: Add micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
micromamba-version: "1.5.6-0" # any version from https://github.com/mamba-org/micromamba-releases | ||
environment-file: conda_jupyter_env.yml | ||
activate-environment: jupyter | ||
python-version: 3.7 | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
init-shell: bash | ||
cache-environment: true | ||
post-cleanup: "all" | ||
|
||
# Would be helpful to cache some of the installation | ||
- name: Install pip dependencies | ||
shell: bash -l {0} | ||
run: | | ||
# sed '/^[[:blank:]]*#/d;s/#.*//' apt_get_packages.txt > apt_get_packages_no_comment.txt | ||
# sudo xargs apt-get -y install < apt_get_packages_no_comment.txt | ||
# Would be helpful to cache some of the installation | ||
- name: Install pip dependencies | ||
shell: bash -l {0} | ||
run: | | ||
# sed '/^[[:blank:]]*#/d;s/#.*//' apt_get_packages.txt > apt_get_packages_no_comment.txt | ||
# sudo xargs apt-get -y install < apt_get_packages_no_comment.txt | ||
# Conda cache will not catch the pip installations (need to do this separately) | ||
pip install jupyter-book | ||
npm install -g reveal-md | ||
# Conda cache will not catch the pip installations (need to do this separately) | ||
pip install jupyter-book | ||
npm install -g reveal-md | ||
# Build the book | ||
- name: Build the book | ||
shell: bash -l {0} | ||
run: | | ||
cd Jupyterbook | ||
source build_book.sh | ||
# Build the book | ||
- name: Build the book | ||
shell: bash -l {0} | ||
run: | | ||
cd Jupyterbook | ||
source build_book.sh | ||
# # Push the book's HTML to github-pages | ||
# - name: GitHub Pages action | ||
# uses: peaceiris/[email protected] | ||
# with: | ||
# github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# publish_dir: Jupyterbook/_build/html | ||
|