[chore] render waveform #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Render | |
on: | |
push: | |
branches: ["image"] | |
permissions: | |
actions: write | |
contents: write | |
jobs: | |
render: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
- name: Convert diagram to svg | |
uses: rlespinasse/drawio-export-action@v2 | |
with: | |
format: svg | |
path: diagram | |
output: render | |
remove-page-suffix: true | |
- name: Convert waveform to svg | |
run: | | |
npm i wavedrom-cli -g | |
mkdir -p waveform/render | |
for file in waveform/*.json5; do | |
wavedrom-cli -i $file -s waveform/render/$(basename $file .json5).svg | |
done | |
- name: Upload svg | |
run: | | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
git add diagram/render/*.svg | |
git add waveform/render/*.svg | |
git diff-index --quiet HEAD || git commit -m "[bot] render diagrams" | |
git push |