Skip to content

Commit 8b1aedf

Browse files
committed
feat: add text-top parameter, split generate-svg workflow, bilingual docs
- Add text-top input to control vertical text position - Split SVG generation into separate generate-svg.yml (daily cron + push) - Remove upload-artifact, use peaceiris/actions-gh-pages to deploy to output branch - Remove unused wait.ts template files - Add README_zh.md for Chinese documentation
1 parent de323ee commit 8b1aedf

9 files changed

Lines changed: 239 additions & 331 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,6 @@ jobs:
3737
id: npm-ci-test
3838
run: npm run ci-test
3939

40-
test-action:
41-
name: GitHub Actions Test
42-
runs-on: ubuntu-latest
43-
44-
steps:
45-
- name: Checkout
46-
id: checkout
47-
uses: actions/checkout@v6
48-
49-
- name: Test Local Action
50-
id: test-action
51-
uses: ./
52-
with:
53-
milliseconds: 2000
54-
55-
- name: Print Output
56-
id: output
57-
run: echo "${{ steps.test-action.outputs.time }}"
40+
- name: Bundle
41+
id: bundle
42+
run: npm run bundle

‎.github/workflows/generate-svg.yml‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Daily Gravity SVG
2+
3+
on:
4+
schedule:
5+
# 每天 UTC 0:00 运行(北京时间 8:00)
6+
- cron: '0 0 * * *'
7+
push:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
generate-and-deploy:
16+
name: Generate SVG & Deploy
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
23+
- name: Setup mise
24+
uses: jdx/mise-action@v2
25+
26+
- name: Install Dependencies
27+
run: bun install --frozen-lockfile
28+
29+
- name: Bundle
30+
run: npm run bundle
31+
32+
- name: Generate Gravity SVG
33+
uses: ./
34+
with:
35+
username: Orta
36+
text: Orta Therox
37+
output-path: gravity.svg
38+
sample-rate: '8'
39+
40+
- name: Deploy to output branch
41+
uses: peaceiris/actions-gh-pages@v4
42+
with:
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
publish_dir: .
45+
publish_branch: output
46+
keep_files: false
47+
force_orphan: true

0 commit comments

Comments
 (0)