ci: fix vhs setup (#1871) #661
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: Publish documentation | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| jobs: | |
| update-cli-screenshots: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25.1' | |
| - name: Set up VHS | |
| run: | | |
| sudo apt update | |
| sudo apt install -y ffmpeg ttyd | |
| go install github.com/charmbracelet/vhs@latest | |
| - name: Install dependencies | |
| run: | | |
| uv --version | |
| uv sync --frozen --group base --group script | |
| - name: Update CLI screenshots | |
| run: | | |
| uv run --no-sync poe doc:screenshots | |
| - name: Commit and push updated CLI screenshots | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/images/cli_help docs/images/cli_interactive | |
| if [[ -n "$(git status --porcelain)" ]]; then | |
| git commit -m "docs(cli/screenshots): update CLI screenshots" -m "[skip ci]" | |
| git push | |
| else | |
| echo "No changes to commit. Skipping." | |
| fi | |
| publish-documentation: | |
| runs-on: ubuntu-latest | |
| needs: update-cli-screenshots | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}" | |
| fetch-depth: 0 | |
| - name: Pull latest changes | |
| run: | | |
| git pull origin master | |
| - name: Set up Python | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install dependencies | |
| run: | | |
| uv --version | |
| uv sync --frozen --only-group base --only-group documentation | |
| - name: Generate Sponsors 💖 | |
| uses: JamesIves/github-sponsors-readme-action@v1 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN_FOR_ORG }} | |
| file: "docs/README.md" | |
| organization: true | |
| - name: Build docs | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| uv run --no-sync poe doc:build | |
| - name: Deploy 🚀 | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| folder: ./site # The folder the action should deploy. | |
| branch: gh-pages |