Merge pull request #598 from gitautoai/wes #122
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: Generate OG Images | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "app/**/page.tsx" | |
| - "app/**/layout.tsx" | |
| - "app/components/**" | |
| - "styles/**" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| generate-og-images: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright | |
| run: npx playwright install --with-deps chromium | |
| - name: Build and start server | |
| env: | |
| NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }} | |
| STRIPE_SECRET_KEY: ${{ secrets.STRIPE_SECRET_KEY }} | |
| SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }} | |
| RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} | |
| run: | | |
| npm run build | |
| npm start & | |
| npx wait-on http://localhost:3000 --timeout 60000 | |
| - name: Generate OG images for all pages | |
| run: node .github/scripts/generate-og-images.mjs | |
| - name: Commit and push if changes | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add public/og/ | |
| if ! git diff --staged --quiet; then | |
| git commit -m "chore: update OG images [skip ci]" | |
| git push | |
| fi |