Skip to content

Commit

Permalink
Update build_book_dont_deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoresi committed Jul 22, 2024
1 parent 235744a commit 907828c
Showing 1 changed file with 44 additions and 47 deletions.
91 changes: 44 additions & 47 deletions .github/workflows/build_book_dont_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: test-build-book
on:
push:
branches-ignore:
- master
- master

workflow_dispatch:

Expand All @@ -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

0 comments on commit 907828c

Please sign in to comment.