Deploy Nitro apps to Deno Deploy.
deno_deploy (switch to this preset)
You can use deployctl to deploy your app.
Login to Deno Deploy to obtain a
DENO_DEPLOY_TOKEN access token, and set it as an environment variable.
# Build with the deno_deploy NITRO preset NITRO_PRESET=deno_deploy npm run build # Make sure to run the deployctl command from the output directory cd .output deployctl deploy --project=my-project server/index.ts
You just need to include the deployctl GitHub Action as a step in your workflow.
You do not need to set up any secrets for this to work. You do need to link your GitHub repository to your Deno Deploy project and choose the "GitHub Actions" deployment mode. You can do this in your project settings on https://dash.deno.com.
name: deno-deploy on: push: branches: - main pull_request: branches: - main jobs: deploy: steps: - uses: actions/checkout@v3 - run: corepack enable - uses: actions/setup-node@v3 with: node-version: 18 cache: pnpm - run: pnpm install - run: pnpm build env: NITRO_PRESET: deno_deploy - name: Deploy to Deno Deploy uses: denoland/deployctl@v1 with: project: my-project entrypoint: server/index.ts root: .output