Repository navigation
Update demo screenshots #34
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: Update demo screenshots | |
| on: | |
| schedule: | |
| - cron: '0 6 * * 1' # Mondays 06:00 UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: update-screenshots | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| screenshots: | |
| name: Capture and open PR | |
| runs-on: ubuntu-latest | |
| environment: Production | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: pnpm | |
| - name: Validate screenshot configuration | |
| shell: bash | |
| env: | |
| DEMO_EMAIL: ${{ secrets.DEMO_EMAIL }} | |
| DEMO_PASSWORD: ${{ secrets.DEMO_PASSWORD }} | |
| run: | | |
| missing=() | |
| for name in DEMO_EMAIL DEMO_PASSWORD; do | |
| if [[ -z "${!name}" ]]; then | |
| missing+=("$name") | |
| fi | |
| done | |
| if (( ${#missing[@]} > 0 )); then | |
| joined=$(printf '%s, ' "${missing[@]}") | |
| joined=${joined%, } | |
| echo "::error title=Missing screenshot configuration::Missing required Production environment values: ${joined}" | |
| echo "Define these as secrets on the Production environment used by this job." | |
| exit 1 | |
| fi | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Install Playwright browsers | |
| run: pnpm exec playwright install --with-deps chromium | |
| - name: Capture screenshots | |
| run: pnpm screenshots | |
| env: | |
| DEMO_EMAIL: ${{ secrets.DEMO_EMAIL }} | |
| DEMO_PASSWORD: ${{ secrets.DEMO_PASSWORD }} | |
| DEMO_BASE_URL: ${{ vars.DEMO_BASE_URL }} | |
| # The capture script writes a screenshot, the served HTML and a network | |
| # report for every failed attempt. Without these a failure is just an | |
| # opaque selector timeout that cannot be reproduced off a runner. | |
| - name: Upload failure diagnostics | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: screenshot-diagnostics | |
| path: screenshot-diagnostics/ | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| - name: Open pull request | |
| uses: peter-evans/create-pull-request@v6 | |
| with: | |
| branch: chore/update-demo-screenshots | |
| base: main | |
| commit-message: 'chore: update landing page demo screenshots' | |
| title: 'chore: update landing page demo screenshots' | |
| body: | | |
| Automated refresh of the landing-page hero screenshots from the live demo. | |
| Review the rendered image diff below before merging. No changes means the | |
| UI has not visibly shifted since the last run. | |
| add-paths: | | |
| components/home/img/demo_light.png | |
| components/home/img/demo_dark.png | |
| components/home/img/demo_mobile_light.png | |
| components/home/img/demo_mobile_dark.png | |
| delete-branch: true |