Build pages #207
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 pages | |
on: | |
push: | |
branches: ["main"] | |
schedule: | |
- cron: "0 15 * * *" # Daily PST 8am | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Allow only latest build to run | |
concurrency: | |
group: "build" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
- name: Checkout ketozhang/Journal | |
uses: actions/checkout@v4 | |
with: | |
repository: "ketozhang/Journal" | |
path: src | |
ssh-key: ${{ secrets.ID_RSA }} | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10.7' | |
cache: 'pip' | |
cache-dependency-path: "requirements.lock" | |
- name: Install uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Install Python dependencies | |
run: uv pip sync requirements.lock | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
- 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 }} |