-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (40 loc) · 1.13 KB
/
auto-publisher.yml
File metadata and controls
49 lines (40 loc) · 1.13 KB
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
name: Publish New Article
on:
workflow_dispatch:
workflow_call:
push:
paths:
- 'src/**'
- '**.py'
- '**.md'
- '**.c'
- '**.ltx'
jobs:
publish_article:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Fetch Article
run: git pull origin main
- name: Setup TeX Environment
run: |
sudo apt-get update
sudo apt install -y texlive-luatex texlive-latex-base texlive-lang-cjk
- name: Verify C Support
run: cc -v
- name: Publish Individual Post
run: python3 make.py post
- name: Publish Batch Monthly
run: |
mkdir -p ./public/batch
python3 make.py batch
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: automated publish" || echo "no changes to commit"
git push origin HEAD:main