-
Notifications
You must be signed in to change notification settings - Fork 18
52 lines (42 loc) · 1.36 KB
/
update-about.yaml
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
name: Update About Page
on:
schedule:
- cron: "0 0 * * *" # This sets the workflow to run at 00:00 UTC+0 every day (8 AM Beijing time)
push:
paths:
- "scripts/about/update_about.py"
workflow_dispatch:
jobs:
update-about-page:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
env:
PYTHONPATH: /home/runner/work/hoa-moe/hoa-moe
steps:
- name: Checkout
uses: actions/checkout@v4 # checkout the repository content to github runner
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Set execute permissions
run: find ./scripts \( -name "*.sh" -o -name "*.py" \) -exec chmod +x {} \;
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Python packages
run: |
python -m pip install --upgrade pip
pip install -r scripts/requirements.txt
- name: Execute Python script
env:
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/about/update_about.py
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
add: "content/about/index.zh-cn.md"
pull: "--rebase --autostash"
default_author: github_actions
message: "ci: update about page"