Implement CI to automatically generate documentation gifs using vhs #13
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: Generate gifs from VHS tapes | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- docs/tapes/*.tape | |
jobs: | |
vhs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: pip | |
- name: Setup Kapitan | |
run: | | |
python -m pip install --upgrade pip | |
pip install git+https://github.com/kapicorp/kapitan@init-with-copier | |
- name: setup VHS | |
run: | | |
go install github.com/charmbracelet/vhs@latest | |
- name: run VHS | |
run: | | |
# shellcheck disable=SC2086 | |
for file in docs/tapes/*.tape | |
do | |
filename="$(basename ${file})" | |
$HOME/go/bin/vhs "${file}" -o "docs/vhs/gifs/${filename%%.tape}.gif" | |
done | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
commit_message: Update generated VHS GIF | |
commit_user_name: vhs-action 📼 | |
commit_user_email: [email protected] | |
commit_author: vhs-action 📼 <[email protected]> | |
file_pattern: '*.gif' |