mirror of
https://github.com/TeachBooks/manual.git
synced 2026-11-12 22:35:51 +00:00
Add CI
This commit is contained in:
parent
a40c45d2ac
commit
3ef4f6e73a
1 changed files with 54 additions and 0 deletions
54
.github/workflows/deploy.yml
vendored
Normal file
54
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "book/**"
|
||||
- ".github/workflows/**"
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
build-book:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
# Setup virtualenv with caching
|
||||
- name: Setup venv
|
||||
uses: syphar/restore-virtualenv@v1
|
||||
with:
|
||||
requirement_files: requirements.txt
|
||||
|
||||
# Pip download cache
|
||||
- name: Setup pip cache
|
||||
uses: syphar/restore-pip-download-cache@v1
|
||||
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
|
||||
|
||||
# Install dependencies
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
pip install -r requirements.txt
|
||||
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
|
||||
|
||||
# Build the Jupyter Book
|
||||
- name: Build book
|
||||
run: |
|
||||
make book
|
||||
|
||||
- name: GitHub Pages actions
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
folder: book/_build/html/
|
||||
Loading…
Add table
Add a link
Reference in a new issue