Skip to content

Commit

Permalink
Change workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ademariag committed Sep 1, 2024
1 parent 4bcbcbc commit de1bc1a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
40 changes: 13 additions & 27 deletions .github/workflows/vhs.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,13 @@
name: Generate gifs from VHS tapes
on:
workflow_dispatch:
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
Expand All @@ -41,9 +18,18 @@ jobs:
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 }}
- 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})"
vhs "${file}" -o "docs/vhs/gifs/${filename%%.tape}.gif"
done
- uses: stefanzweifel/git-auto-commit-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
Binary file added docs/vhs/gifs/kapitan-init.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit de1bc1a

Please sign in to comment.