All skills
denoland avatar

/deno-deploy

@2311d69 official
by Denodenoland/skills99 stars
8

Use when deploying Deno apps to production, asking about Deno Deploy, or working with `deno deploy` CLI commands. Covers deployment workflows, environment variables, KV database access, custom domains, the --tunnel flag for local development, and the `deno deploy` command reference.

Use this Skill: https://skilld.dev/gh/denoland/skills/deno-deploy

This session only. Nothing lands on disk.

referencesAUTHENTICATION.md

≈1.2k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Deno Deploy Authentication

Interactive Authentication (Default)

The first time you run deno deploy, it will open a browser for authentication:

deno deploy
# Opens: https://console.deno.com/auth?code=XXXX-XXXX

Important - Browser Device Authorization Flow:

  • The CLI opens your browser and waits for you to complete authentication
  • You must complete the authorization in your browser before the CLI can continue
  • The CLI will not proceed automatically - it waits until you finish
  • Credentials are stored in your system keyring after successful auth

Note: When running deno deploy commands that require authentication, the user must complete the browser authorization before the deployment can proceed.

Non-Interactive Authentication (CI/CD & Automation)

To deploy without browser interaction (for CI/CD pipelines or automated workflows):

1. Create a Deploy Token

  1. Visit https://console.deno.com/account/access-tokens
  2. Click "New Access Token"
  3. Give it a descriptive name (e.g., "GitHub Actions CI")
  4. Copy the token immediately (shown only once)

2. Use the Token

# Option 1: Environment variable (recommended for CI/CD)
export DENO_DEPLOY_TOKEN="your-token-here"
deno deploy --prod

# Option 2: Inline flag (for one-off commands)
deno deploy --token "your-token-here" --prod

3. GitHub Actions Example

- name: Deploy to Deno Deploy
  env:
    DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
  run: deno deploy --prod

If the app doesn't exist yet, create it first in CI/CD using non-interactive flags:

- name: Create and deploy app
  env:
    DENO_DEPLOY_TOKEN: ${{ secrets.DENO_DEPLOY_TOKEN }}
  run: |
    deno deploy create \
      --org my-org --app my-app \
      --source local \
      --runtime-mode dynamic --entrypoint main.ts \
      --build-timeout 10 --build-memory-limit 2048 --region us

After the app is created, subsequent deploys only need deno deploy --prod.

Tip: For fully automated deploys without browser prompts, ensure a Deno Deploy access token is set up. Create one at https://console.deno.com/account/access-tokens, then set it as the DENO_DEPLOY_TOKEN environment variable.

Finding Your Organization Name

The Deno Deploy CLI requires an organization context for most operations. To find your org name:

  1. Visit https://console.deno.com
  2. Your org is in the URL: console.deno.com/YOUR-ORG-NAME

Note: Commands like deno deploy orgs and deno deploy switch require an existing org context to work - this is a CLI limitation. Always find your org name from the console URL first.

Setting Up Your First App

Before creating: Check if an app already exists:

cat deno.json | grep -A5 '"deploy"'

If no deploy config exists, you need to create the app first. Apps must be created before they can be deployed to.

Interactive creation (opens a browser):

deno deploy create --org your-org-name

This opens a browser to create the app. Important:

  • Complete the app creation in your browser
  • The CLI waits until you finish - it won't proceed automatically
  • The app name becomes your URL: <app-name>.deno.dev

Non-interactive creation (for AI agents and CI/CD — no browser needed):

deno deploy create \
  --org your-org-name \
  --app your-app-name \
  --source local \
  --runtime-mode dynamic \
  --entrypoint main.ts \
  --build-timeout 5 \
  --build-memory-limit 1024 \
  --region us

This creates the app and does the initial deploy in one step. No browser interaction required. See the main skill doc for the full list of create flags.

Verifying Success: After completion, verify by checking deno.json:

cat deno.json | grep -A5 '"deploy"'

You should see:

"deploy": {
  "org": "your-org-name",
  "app": "your-app-name"
}

After this, subsequent deploys only need:

deno deploy --prod

Interactive Commands

Some deno deploy commands are interactive and cannot be run through automated tools.

Switching Organizations/Apps

deno deploy switch

This opens an interactive menu to select org and app.

Alternative - Use Explicit Flags:

Instead of interactive selection, specify org/app directly:

deno deploy --org your-org-name --app your-app-name --prod

This bypasses the interactive flow.

Commands That Fail Without Org Context

These commands will error if no org is configured:

  • deno deploy (without --org flag)
  • deno deploy orgs
  • deno deploy switch
  • deno deploy env list
  • deno deploy logs

Always ensure org context is set via deno.json or --org flag before running these commands.

Source: SKILL.md on GitHub

1 warning16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    This skill provides safe and standard reference guidelines and deployment documentation for the Deno Deploy CLI. It covers configuration files, environment variables, command references, and databases without introducing dangerous command scripts, malicious prompt adjustments, obfuscated paths, or external download vulnerabilities.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    9/9 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 2311d69. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 days ago.

Steadyupdated 2 months ago
metadata
{
  "author": "denoland",
  "version": "1.5"
}
  • CLI
  • deno
  • deno-deploy
  • deployment
  • environment-variables
  • kv
  • custom-domains
  • production

README badge

README badge for denoland/skills/deno-deploy

Guides deployment of Deno applications to Deno Deploy using the `deno deploy` CLI (requires Deno >= 2.4.2). Covers app creation, production and preview deploys, environment variables across contexts, KV database provisioning, and the `--tunnel` flag for local development.

Generated from the current SKILL.md.

Does this skill cover the deprecated `deployctl` command?
No. This skill uses only the modern `deno deploy` command (requires Deno >= 2.4.2). The `deployctl` command is deprecated and not covered.
Can I use this skill to deploy to other platforms like Vercel or AWS Lambda?
No. This skill applies only to Deno Deploy. For other platforms, use their platform-specific guidance directly.
What should I do if my app connects to a database at startup?
Create the app with `--no-wait`, provision and assign the database with `deno deploy database` commands, then redeploy so the database exists before warmup.
Do I need to add configuration to deno.json before deploying?
Only if you have an existing app on Deno Deploy. For new apps, `deno deploy create` sets up the config automatically. For subsequent deploys, `deno deploy --prod` uses the stored org and app names.
How do I set different environment variables for production and preview deployments?
Deno Deploy supports separate contexts: Production (live traffic), Development (previews), and Build (during builds). You can set different values for the same variable in each context using the CLI.

Generated from the current SKILL.md. These answers refresh after source changes.