fix: better admin review interface (#31) #21
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
| # Deploy Hex Flower Engine to Cloudflare Pages | |
| name: Deploy to Cloudflare Pages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| concurrency: | |
| group: "cloudflare-pages-${{ github.ref }}" | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout | |
| 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: Type check | |
| run: npm run type-check | |
| - name: Build | |
| run: npm run build | |
| # Only run migrations and deploy on push to main (not PRs) | |
| - name: Run D1 Migrations | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: d1 migrations apply hex-flower-engine-db --remote | |
| - name: Deploy to Cloudflare Pages | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy dist --project-name=hex-flower-engine | |
| # For PRs, just report build success | |
| - name: Build Success | |
| if: github.event_name == 'pull_request' | |
| run: echo "✅ Build and type check passed for PR" |