Deno logoDeno

Projects

Projects are the most central resource in Deno Deploy. They group deployments, custom domains, and environment variables. Projects can be linked to a GitHub repository to enable the Deno Deploy Git integration.

Creating a Project

To create a project click on the New Project button on the Deno Deploy dashboard, or navigate to https://dash.deno.com/new.

Project names must be between 3 and 24 characters long, only contain a-z, 0-9 and -, and must not start or end with a hyphen (-). The project name will determine a project's production URL. It has the form $PROJECT_ID.deno.dev (e.g. https://hello.deno.dev). The production URL is the URL that your production deployment can be reached at.

Settings

In the project settings a project can be renamed, transferred to a different organization, or deleted. When renaming a project, the production URL of the project will be changed and traffic to the old URL will be dropped.

To transfer a project to a different organization select the receiving organization from the dropdown menu and press Transfer. You need to be a member of the receiving organization to transfer a project.

Deleting a project also deletes all linked custom domains, environment variables and deployments.

Domains

By default a deployment can be reached by it's preview URL, or by the project URL if the project has a production deployment. These domains always end in .deno.dev. It is also possible to use custom domains to serve traffic.

You must own the domain that you want to add to a project. If you do not own a domain yet, you can register one at a domain registrar like Google Domains, Namecheap, or gandi.net.

Adding a Domain

Domains can be added in the domain settings page of a project. To navigate there, click the "Settings" button on the project page, then select "Domains" from the sidebar.

Enter the domain name you wish to add to the project and press "Add". The domain is added to the domains list and will have a "Needs setup" badge. Click on the "Needs setup" badge to visit the domain setup page which will display the list of DNS records that need to be created/updated for your domain.

To update DNS records of your domain, go to the DNS configuration panel of your domain registrar (or the service you're using to manage DNS) and enter the records as described on the domain setup page. Once you have the DNS records updated, click the "Validate" button on the domain setup page. It will check if the DNS records are correctly set and updates the status to "Validated, needs a certificate".

At this point you have two options: let us automatically provision a certificate using Let's Encrypt, or you can manually upload a certificate and private key.

To automatically provision a certificate, press the "Provision Automatically" button. Provisioning a TLS certificate can take up to a minute. It is possible that the provisioning fails if your domain specifies a CAA record that prevents Let's Encrypt from provisioning certificates. Certificates will be automatically renewed around 30 days before the certificate expires.

To manually upload a certificate chain and private key, press the "Upload Manually" button. You will be prompted to upload a certificate chain and private key. The certificate chain needs to be complete and valid, and your leaf certificate needs to be at the top of the chain.

Environment Variables

Environment variables are useful to store values like access tokens of web services. You can create them in the project dashboard and access them in your code via the Deno.env API. They are made available to both production and preview deployments.

To add an environment variable to your project, click on the "Settings" button on the project page and then on "Environment Variables" from the sidebar. Fill in the key/value fields and click on "Add" to add an environment variable to your project. A new production deployment will be created automatically with the new environment variables.

Preset Variables

Every deployment has the following environment variables preset, which you can access from your code.

  1. DENO_REGION

It holds the region code of the region in which the deployment is running. You can use this variable to serve region-specific content.

You can refer to the region code from the regions page.

  1. DENO_DEPLOYMENT_ID

It holds the ID of the deployment.

Git Integration

The Git integration enables deployment of code changes that are pushed to a GitHub repository. Commits on the production branch will be deployed as a production deployment. Commits on all other branches will be deployed as a preview deployment.

There are two modes of operation for the Git integration:

  • Automatic: Deno Deploy will automatically pull code and assets from your repository source every time you push, and deploy it. This mode is very fast, but does not allow for a build step. This is the recommended mode for most users.
  • GitHub Actions: In this mode you push your code and assets to Deno Deploy from a GitHub Actions workflow. This allows you to perform a build step before deploying.

Enabling

To enable the Git integration, follow these steps:

  1. Click on the Settings button on the project page and then select Git from the sidebar.
  2. Select your organization name, and repository. If your repository or organization does not show up, make sure the Deno Deploy GitHub App is installed on your repository.
  3. Select a production branch. Code deployed from this branch will be deployed as a production deployment instead of a preview deployment.
  4. Choose either Automatic or GitHub Actions deployment mode. The difference between these modes is explained above.
  5. Depending on the mode, do the following:
    • If you chose Automatic, select the entrypoint for your project.
    • If you chose GitHub Actions, press the Link button.

If you chose GitHub Actions mode, you will now need to add the Deno Deploy GitHub Action to your workflow file. You can find an explanation on how to do this in the Deno Deploy dashboard, and the documentation for the Deno Deploy Action.

Disabling

You can disable the Git integration by pressing the Unlink button on the Git settings page of your project.