refactor: optimize imports, adjust boot timeout, and enhance loading … #29
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: Deploy to Cloudflare Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| deployments: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install frontend dependencies | |
| run: npm ci | |
| - name: Prepare Deploy Assets | |
| id: check_limits | |
| run: npm run deploy:prepare | |
| - name: Publish to Cloudflare Pages | |
| id: deploy | |
| if: steps.check_limits.outcome == 'success' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) | |
| uses: cloudflare/wrangler-action@v4 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy public --project-name=frappe-playground | |
| gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Add deployment URL to summary | |
| if: steps.deploy.outputs.deployment-url != '' | |
| run: | | |
| echo "### Cloudflare Pages deployment" >> "$GITHUB_STEP_SUMMARY" | |
| echo "${{ steps.deploy.outputs.deployment-url }}" >> "$GITHUB_STEP_SUMMARY" |