Deno Deploy
Deno Deploy serves static and dynamic sites from its global edge network. For static sites, use GitHub Actions to build, optimize with pageflare, and deploy with deployctl.
How It Works
Section titled “How It Works”Deno Deploy integrates with GitHub for automatic deployments. Add the pageflare GitHub Action between your build step and the Deno deploy step.
Step 1 — Create the Workflow
Section titled “Step 1 — Create the Workflow”name: Deploy to Deno Deploy
on: push: branches: [main]
jobs: deploy: runs-on: ubuntu-latest permissions: id-token: write contents: read steps: - uses: actions/checkout@v4
- name: Setup Node uses: actions/setup-node@v4 with: node-version: 22
- name: Build site run: npm ci && npm run build
- name: Optimize with pageflare uses: getappz/pageflare-cli@v1 with: args: "dist/ --in-place" env: PAGEFLARE_LICENSE: ${{ secrets.PAGEFLARE_LICENSE }}
- name: Deploy to Deno Deploy uses: denoland/deployctl@v1 with: project: my-site entrypoint: https://deno.land/std/http/file_server.ts root: dist/Step 2 — Pro License
Section titled “Step 2 — Pro License”Add PAGEFLARE_LICENSE as a GitHub repository secret:
- Go to Settings > Secrets and variables > Actions.
- Add a secret named
PAGEFLARE_LICENSEwith your license key.
Step 3 — Verify
Section titled “Step 3 — Verify”After pushing, check the Actions tab in your repository. Look for the pageflare summary in the “Optimize with pageflare” step:
Done 145.2 KB saved (38.1%) 1.2s Files 42 total, 38 optimized, 4 unchanged, 0 errorsFramework Output Directories
Section titled “Framework Output Directories”| Framework | Output directory |
|---|---|
| Astro | dist/ |
| Vite | dist/ |
| Hugo | public/ |
| Eleventy | _site/ |
Update the root and pageflare input directory to match your framework.
Troubleshooting
Section titled “Troubleshooting”Deploy uses unoptimized files
Make sure the pageflare step runs before the deploy step. The --in-place flag overwrites files in the output directory.