Implement CI to automatically generate documentation gifs using vhs #7
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: | |
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: 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' |