name: demo
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "src/**"
- "demos/**"
- "e2e/**"
- "Cargo.toml"
- "Cargo.lock"
permissions:
contents: write
pull-requests: write
jobs:
demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
- name: Screenshots (doc/img)
run: uv run --project e2e python demos/shots.py
- name: Build binary for the tape
run: docker compose run --build --rm release
- name: Render demo.gif
run: docker run --rm -v "$PWD:/vhs" -w /vhs ghcr.io/charmbracelet/vhs demos/demo.tape
- name: Open artifacts PR if renders changed
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add doc/demo.gif doc/img/
git diff --cached --quiet && exit 0
git checkout -B demo/artifacts
git commit -m "docs: refresh demo.gif + screenshots"
git push -f origin demo/artifacts
if ! gh pr view demo/artifacts --json state -q .state 2>/dev/null | grep -q OPEN; then
gh pr create --base main --head demo/artifacts \
--title "docs: refresh demo.gif + screenshots" \
--body "Re-rendered demo artifacts from the demo workflow. Docs-only: bot PRs don't trigger CI, so merge with the admin override."
fi