Update ghfetch gif with vhs #1492
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: Update ghfetch gif with vhs | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' | |
- name: Install latest ttyd | |
run: | | |
wget https://github.com/tsl0922/ttyd/releases/download/1.7.4/ttyd.x86_64 | |
chmod +x ttyd.x86_64 | |
sudo mv ttyd.x86_64 /usr/local/bin/ttyd | |
ttyd --version | |
- name: Install ffmpeg | |
run: | | |
sudo apt update | |
sudo apt install -y ffmpeg | |
- name: Install vhs and ghfetch | |
run: | | |
go install github.com/orangekame3/ghfetch@latest | |
go install github.com/charmbracelet/vhs@latest | |
- name: Generate ghfetch gif with vhs | |
run: | | |
export GITHUB_TOKEN=${{ secrets.GH_PAT }} | |
vhs < img/demo.tape | |
- name: Commit and push if there are changes | |
run: | | |
git add img/demo.gif | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git commit -m "Update ghfetch gif with vhs" -a || echo "No changes to commit" | |
git push |