Skip to content

Commit b565cc2

Browse files
committed
👷 添加自动渲染 SVG 工作流
1 parent ef32273 commit b565cc2

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Render files in ./docs-pg to SVG
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs-pg/**"
9+
workflow_dispatch:
10+
11+
jobs:
12+
render-svg:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Install Project Graph
19+
run: |
20+
gh release download -p "*.deb" -O project-graph.deb
21+
sudo apt-get update
22+
sudo apt-get install -y ./project-graph.deb
23+
env:
24+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
- name: Install xvfb
26+
run: sudo apt-get install -y xvfb
27+
- name: Render SVG files
28+
run: |
29+
cd docs-pg
30+
for file in *.json; do
31+
echo "Rendering $file"
32+
xvfb-run -a project-graph "$file" -o "${file%.json}.svg"
33+
done
34+
- name: Commit files
35+
run: |
36+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
37+
git config --local user.name "github-actions[bot]"
38+
git commit -a -m "📝 Render SVG files"
39+
- name: Push changes
40+
uses: ad-m/github-push-action@master
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)