--- 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 }}