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
name: Generate Demo GIF
on:
workflow_dispatch: # Manual trigger
push:
paths:
- 'demo/**'
- '.github/workflows/demo.yml'
jobs:
generate-gif:
runs-on: macos-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
- name: Install VHS
run: brew install vhs
- name: Generate Demo GIF
run: |
cd demo
vhs demo.tape
- name: Upload GIF artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: demo-gif
path: demo/axterminator_demo.gif
retention-days: 30
- name: Commit GIF (if on main)
if: github.ref == 'refs/heads/main'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
if [ -f demo/axterminator_demo.gif ]; then
git add demo/axterminator_demo.gif
git diff --staged --quiet || git commit -m "Update demo GIF [skip ci]"
git push
fi