Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions .github/workflows/generate-terminal-gifs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,7 @@ permissions:
pull-requests: write

jobs:
run-tapes:
strategy:
matrix:
tapes:
- 'docs/vhs/install.tape'
- 'docs/vhs/basic-usage.tape'
- 'docs/vhs/yaml-config.tape'
- 'docs/vhs/mappings-demo.tape'
- 'docs/vhs/multiple-mappings.tape'
- 'docs/vhs/advanced-features.tape'
- 'docs/vhs/remote-content.tape'
- 'docs/vhs/schema-generation.tape'
generate-gifs:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -32,16 +21,25 @@ jobs:
with:
python-version: '3.x'

- uses: charmbracelet/vhs-action@v2
with:
path: ${{ matrix.tapes }}
- name: Install VHS
run: |
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://repo.charm.sh/apt/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/charm.gpg
echo "deb [signed-by=/etc/apt/keyrings/charm.gpg] https://repo.charm.sh/apt/ * *" | sudo tee /etc/apt/sources.list.d/charm.list
sudo apt-get update && sudo apt-get install -y vhs

- name: Generate GIFs
run: bash scripts/generate-gifs.sh

- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update generated VHS GIF
branch: repository-dispatch/update-${{ github.run_id }}
title: Update generated VHS GIF
body: This PR updates the generated VHS GIF files.
commit-message: 'chore: update generated VHS GIFs'
branch: automation/update-vhs-gifs-${{ github.run_id }}
title: '[chore] update generated VHS GIFs'
body: |
This PR updates all generated VHS GIF files.

Triggered by workflow run [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}).
base: main
labels: automation
Binary file modified docs/vhs/advanced-features.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/advanced-features.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/advanced-features.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit Advanced Features Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Generate schema for VSCode autocompletion"
Enter
Type "mkdir -p .vscode"
Expand Down
6 changes: 5 additions & 1 deletion docs/vhs/basic-usage.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/usage.gif

Set Theme "Dracula"
Set FontSize 14
Set FontSize 18
Set Width 1200
Set Height 600
Set Shell "bash"
Expand All @@ -10,6 +10,10 @@ Type "# StructKit - Basic Usage Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# First, let's see what structures are available"
Enter
Sleep 500ms
Expand Down
Binary file modified docs/vhs/install.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/vhs/install.tape
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Output docs/vhs/install.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand Down
Binary file modified docs/vhs/mappings-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/mappings-demo.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/mappings-demo.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit Mappings Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Create a simple mapping file with team data"
Enter
Type "cat > team-mapping.yaml << EOF"
Expand Down
Binary file modified docs/vhs/multiple-mappings.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/multiple-mappings.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/multiple-mappings.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit Multiple Mappings Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Create company info mapping"
Enter
Type "cat > company-info.yaml << EOF"
Expand Down
Binary file modified docs/vhs/remote-content.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/remote-content.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/remote-content.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit Remote Content Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Create configuration with remote files"
Enter
Type "cat > remote-example.yaml << EOF"
Expand Down
Binary file modified docs/vhs/schema-generation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/schema-generation.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/schema-generation.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit Schema Generation Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Generate JSON schema for VSCode autocompletion"
Enter
Type "structkit generate-schema"
Expand Down
Binary file modified docs/vhs/usage.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/vhs/yaml-config.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion docs/vhs/yaml-config.tape
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Output docs/vhs/yaml-config.gif

Set Theme "Monokai Vivid"
Set FontSize 14
Set FontSize 18
Set TypingSpeed 40ms
Set Width 1400
Set Height 800
Expand All @@ -11,6 +11,10 @@ Type "# StructKit YAML Configuration Demo"
Enter
Sleep 1s

Type "source .venv/bin/activate"
Enter
Sleep 500ms

Type "# Create a simple project structure configuration"
Enter
Type "cat > my-project.yaml << EOF"
Expand Down
44 changes: 44 additions & 0 deletions scripts/generate-gifs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"

cd "$PROJECT_ROOT"

echo "==> Running VHS tapes..."
for tape in docs/vhs/*.tape; do
echo " Running: $tape"
vhs "$tape"
done

echo "==> Cleaning up demo artifacts..."

# Files created by tapes (skip any that are git-tracked)
for f in \
remote-demo.yaml \
remote-example.yaml \
project-with-mapping.yaml \
team-mapping.yaml \
company-info.yaml \
environments.yaml \
multi-mapping-project.yaml \
my-project.yaml \
.vscode/struct-schema.json \
.vscode/struct-plugins.schema.json; do
git ls-files --error-unmatch "$f" &>/dev/null || rm -f "$f"
done

# Directories created by tapes
rm -rf \
remote-project/ \
remote-demo/ \
my-python-app/ \
backend-project/ \
dev-app/ \
my-custom-project/

# Remove .vscode dir if now empty
[ -d .vscode ] && rmdir --ignore-fail-on-non-empty .vscode

echo "==> Done! GIFs are in docs/vhs/"
Loading