Skip to content

Implement CI to automatically generate documentation gifs using vhs #11

Implement CI to automatically generate documentation gifs using vhs

Implement CI to automatically generate documentation gifs using vhs #11

Workflow file for this run

name: Generate gifs from VHS tapes
on:
pull_request:
paths:
- docs/tapes/*.tape
push:
branches:
- master
- test-vhs
paths:
- docs/tapes/*.tape
jobs:
generate-matrix:
name: Generate job matrices
runs-on: ubuntu-latest
# don't forget to declare outputs here!
outputs:
vhs-files: ${{ steps.vhs-files.outputs.matrix }}
steps:
- name: Generate matrix | VHS Files
id: vhs-files
uses: hellofresh/action-changed-files@v3
with:
pattern: (?P<path>docs/tapes/(?P<tape>.+)\.tape)
vhs:
needs: [ generate-matrix ]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.generate-matrix.outputs.vhs-files) }}
if: ${{ fromJson(needs.generate-matrix.outputs.vhs-files).include[0] }} # skip if the matrix is empty!
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
- uses: charmbracelet/[email protected]
with:
path: ${{ matrix.path }}
- 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'