deploy #247
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
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * SUN" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# This job installs dependencies, build the book, and pushes it to `gh-pages` | |
jobs: | |
build-and-deploy-book: | |
if: (github.event_name == 'schedule' && github.repository == 'scikit-image/skimage-tutorials') || (github.event_name != 'schedule') | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python-version: [3.8] | |
# TODO Uncomment when skimage theme is ready | |
# node-version: [15] | |
steps: | |
- uses: actions/checkout@v2.3.3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# TODO Uncomment when skimage theme is ready | |
# - name: Set up Node.js ${{ matrix.node-version }} | |
# uses: actions/setup-node@v2 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# Install dependencies | |
- name: Install dependencies | |
run: | | |
# Install linux dependencies | |
sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \ | |
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ | |
libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 xvfb | |
# Start display server for headless execution of napari | |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid \ | |
--make-pidfile --background --exec /usr/bin/Xvfb -- :99 \ | |
-screen 0 1920x1200x24 -ac +extension GLX | |
# Install Python dependencies | |
pip install --upgrade pip | |
pip install -r requirements.txt -r requirements_dev.txt | |
# Install Node.js dependencies | |
# TODO Uncomment when skimage theme is ready | |
# npm install -g npm | |
# yarn install | |
# TODO Uncomment when skimage theme is ready | |
# Build the theme | |
# - name: Build the theme | |
# run: yarn build:theme-prod | |
# Build the book | |
- name: Build the book | |
env: | |
DISPLAY: ":99.0" | |
run: jupyter-book build . | |
# Deploy the book's HTML to github pages | |
- name: GitHub Pages action | |
if: github.repository == 'scikit-image/skimage-tutorials' && github.ref == 'refs/heads/main' && github.event_name == 'push' | |
uses: peaceiris/actions-gh-pages@v3.6.1 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./_build/html | |
cname: scikit-image.org |