Skip to content

Generate Intro Animation #4

Generate Intro Animation

Generate Intro Animation #4

name: Generate Intro Animation
on:
workflow_dispatch:
inputs:
theme:
description: 'agg color theme'
required: false
default: 'solarized-dark'
type: choice
options:
- solarized-dark
- solarized-light
- monokai
- dracula
- github-dark
- github-light
- nord
- gruvbox-dark
- gruvbox-light
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 (${{ inputs.theme || '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 ${{ inputs.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