Update conf.py #71
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: Build | |
on: | |
push: | |
branches: | |
- source | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Init submodule | |
run: | | |
git submodule update --init --recursive | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install dependencies | |
run: | | |
cd ./Maverick | |
python -m pip install --upgrade pip | |
pip install -r prod_req.txt | |
# Get build cache | |
- uses: actions/checkout@v2 | |
with: | |
ref: 'cache' | |
path: './build_cache' | |
- name: Build site | |
run: | | |
# 复用图片解析缓存 | |
mkdir ./Maverick/cached_imgs | |
cp ./build_cache/sizeinfo.json ./Maverick/cached_imgs | |
rm -rf ./build_cache/.git | |
cd ./Maverick | |
python ./build.py -c "../conf.py" | |
# 保存图片缓存 | |
cd .. | |
cp ./Maverick/cached_imgs/sizeinfo.json ./build_cache | |
- name: Deploy to GitHub Pages | |
uses: docker://peaceiris/gh-pages:v2 | |
env: | |
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PUBLISH_BRANCH: gh-pages | |
PUBLISH_DIR: ./dist | |
with: | |
emptyCommits: false | |
- name: Save build cache | |
uses: docker://peaceiris/gh-pages:v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PUBLISH_BRANCH: cache | |
PUBLISH_DIR: ./build_cache | |
with: | |
emptyCommits: false |