Skip to content

♻️ 获取当前系统的路径分隔符,移动位置 #14

♻️ 获取当前系统的路径分隔符,移动位置

♻️ 获取当前系统的路径分隔符,移动位置 #14

name: Render files in ./docs-pg to SVG
on:
push:
branches:
- master
paths:
- "docs-pg/**"
workflow_dispatch:
jobs:
render-svg:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v2
- name: Install Project Graph
run: |
gh release download -p "*.deb" -O project-graph.deb --clobber
sudo apt-get update
sudo apt-get install -y ./project-graph.deb
rm -rf ./project-graph.deb
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install xvfb
run: sudo apt-get install -y xvfb
- name: Render SVG files
run: |
cd docs-pg
for file in *.json; do
echo "Rendering $file"
xvfb-run -a project-graph "$file" -o "${file%.json}.svg"
done
- name: Commit files
run: |
git add .
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "📝 Render SVG files"
git pull
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}