Reset Demo Database #4852
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: Reset Demo Database | |
| on: | |
| schedule: | |
| # Run every 30 minutes | |
| - cron: '*/30 * * * *' | |
| workflow_dispatch: # Allow manual trigger from GitHub UI | |
| # Minimal permissions for security | |
| permissions: | |
| contents: read | |
| jobs: | |
| reset-demo: | |
| runs-on: ubuntu-latest | |
| # Only run on main branch | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate Prisma Client | |
| run: npx prisma generate | |
| - name: Reset Demo Database | |
| run: node scripts/reset-demo-db.mjs | |
| env: | |
| DATABASE_URL: ${{ secrets.DEMO_DATABASE_URL }} | |
| DATABASE_SSL: 'true' | |
| - name: Log completion | |
| run: | | |
| echo "✅ Demo database reset completed at $(date -u +"%Y-%m-%dT%H:%M:%SZ")" |