-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.65 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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 }}