Build pages #128
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
# Simple workflow for deploying static content to GitHub Pages | |
name: Build static content from ketozhang/Journal | |
on: | |
schedule: | |
- cron: "0 15 * * *" # Daily PST 8am | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v3 | |
- name: Checkout ketozhang/Journal | |
uses: actions/checkout@v3 | |
with: | |
repository: "ketozhang/Journal" | |
path: src | |
ssh-key: ${{ secrets.ID_RSA }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10.7' | |
cache: 'pip' | |
cache-dependency-path: "requirements.lock" | |
- name: Install Python dependencies | |
run: pip install -r requirements.lock | |
- name: Build site | |
run: | | |
make clean | |
make -j 5 build | |
- name: Commit files | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add _site/ | |
git diff-index --quiet HEAD || git commit -am "[ci] Pull and build sources from https://github.com/ketozhang/Journal" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} |