summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/generate-gif.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/generate-gif.yml b/.github/workflows/generate-gif.yml
new file mode 100644
index 0000000..ab694b6
--- /dev/null
+++ b/.github/workflows/generate-gif.yml
@@ -0,0 +1,40 @@
+---
+name: Generate GIF Demo
+on:
+ push:
+ branches: [main]
+jobs:
+ generate-gif:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ - name: Set up Go (if required by vhs)
+ uses: actions/setup-go@v3
+ with:
+ go-version: '1.22'
+ - name: Install vhs
+ run: |
+ go install github.com/charmbracelet/vhs@latest
+ - name: Install Gif Generation dependencies
+ run: |
+ sudo apt update
+ sudo apt install ffmpeg ttyd -y
+ - name: Build the termpicker binary for vhs
+ run: go build -o termpicker ./cmd/termpicker
+ - name: Generate GIF with vhs
+ run: |
+ vhs ./assets/demo.tape
+ - name: Commit and push GIF update
+ run: |
+ git config --global user.name 'github-actions'
+ git config --global user.email 'github-actions@github.com'
+ if git diff --quiet; then
+ echo "No changes to commit."
+ else
+ git add ./assets/demo.gif
+ git commit -m 'Update GIF preview'
+ git push
+ fi
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}