Generate Intro Animation #3
This file contains hidden or 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 Intro Animation | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'scripts/workspace-intro.sh' | |
| jobs: | |
| generate: | |
| runs-on: self-hosted | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Record animation | |
| run: | | |
| export TERM=xterm-256color | |
| chmod +x scripts/workspace-intro.sh | |
| asciinema rec \ | |
| --cols 120 \ | |
| --rows 24 \ | |
| --idle-time-limit 2 \ | |
| -c "./scripts/workspace-intro.sh" \ | |
| recording.cast | |
| - name: Convert to GIF (Solarized Dark) | |
| run: | | |
| mkdir -p assets | |
| docker run --rm \ | |
| -v "$(pwd)":/data \ | |
| -v "/home/runner/.local/share/fonts":/fonts:ro \ | |
| agg:latest \ | |
| --font-dir /fonts \ | |
| --speed 1.5 \ | |
| --fps-cap 15 \ | |
| --theme solarized-dark \ | |
| --last-frame-duration 3 \ | |
| /data/recording.cast \ | |
| /data/assets/intro.gif | |
| - name: Commit | |
| run: | | |
| rm -f recording.cast | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config user.name "github-actions[bot]" | |
| git add assets/intro.gif | |
| git diff --staged --quiet || git commit -m "chore: update intro animation" | |
| git push |