diff options
-rw-r--r-- | .github/workflows/generate-gif.yml | 40 | ||||
-rw-r--r-- | assets/demo.tape | 5 |
2 files changed, 42 insertions, 3 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 }} diff --git a/assets/demo.tape b/assets/demo.tape index e837e6a..98c2460 100644 --- a/assets/demo.tape +++ b/assets/demo.tape @@ -1,5 +1,5 @@ # Where should we write the GIF? -Output demo.gif +Output ./assets/demo.gif # Set up a 1200x600 terminal with 46px font. Set FontSize 24 @@ -8,8 +8,7 @@ Set Height 500 Set Shell zsh -Sleep 2.5s -Type "go run ./cmd/termpicker" +Type "./termpicker" Enter Sleep 2s Type "l" |