diff --git a/.github/workflows/cloudflare-pages.yml b/.github/workflows/cloudflare-pages.yml new file mode 100644 index 0000000000..1733db414a --- /dev/null +++ b/.github/workflows/cloudflare-pages.yml @@ -0,0 +1,42 @@ +name: Deploy to Cloudflare Pages + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +concurrency: + group: cloudflare-${{ github.ref }} + cancel-in-progress: true + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + - run: corepack enable + - uses: actions/setup-node@v4 + with: + node-version: 24 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm i + + - name: Build the app + run: pnpm build + env: + VITE_CLOUDFLARE_GIT_COMMIT_SHA: ${{ github.sha }} + VITE_VERCEL_GIT_COMMIT_SHA: ${{ github.sha }} + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy dist/ --project-name=it-tools --branch=${{ github.ref_name }} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 5ed0b5af0d..02365ef112 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,3 @@ allowBuilds: esbuild: true + workerd: true diff --git a/public/_redirects b/public/_redirects new file mode 100644 index 0000000000..bbb3e7a1fb --- /dev/null +++ b/public/_redirects @@ -0,0 +1 @@ +/* /index.html 200