GitHub Actions for deploying to Deno Deploy.
⚠ If your project does not require a build step, we recommend you use the "Automatic" deployment mode of our GitHub integration. It is faster and requires no setup.
To deploy you just need to include the Deno Deploy 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. You have to choose the "GitHub Actions" deployment mode in your project settings on https://dash.deno.com. Read Deno Deploy documentation for more information.
You have to set id-token: write permission to authenticate with Deno Deploy.
jobs:
deploy:
permissions:
id-token: write # required
contents: read
steps:
# your steps here...- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
# Name of the project on Deno Deploy
# Required.
project:
# Entrypoint location executed by Deno Deploy
# The entrypoint can be a relative path or an absolute URL.
# If it is a relative path, it will be resolved relative to the `root` directory.
# Required.
entrypoint:
# Root directory to deploy
# All files and subdirectories will be deployed.
# Optional. Default is "process.cwd()"
root:
# Filter which files to include in the deployment
# It supports a single file, multiple files separated by a comma or by a newline
# Optional.
include:
# Filter which files to exclude in the deployment
# It supports a single file, multiple files separated by a comma or by a newline
# Optional.
exclude:
# Location of an import map
# Must be relative to root directory
# Optional.
import-map:All files and subdirectories in the working directory will be deployed.
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: main.tsAll files and subdirectories in the specified directory will be deployed.
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: main.ts # the entrypoint is relative to the root directory (path/to/your/directory/main.ts)
root: path/to/your/directoryUse include and exclude to filter which contents to deploy.
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: main.ts # the entrypoint must be relative to the root directory
include: |
main.ts
dist
exclude: node_modulesYou can set a single file
include: main.tsmultiple files or directories, separated by a comma
include: main.ts,distor separated by a newline
include: |
main.ts
distentrypoint supports absolute path (file://) and external path (https://)
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: https://your-external-path/mod.tsAn interesting use case is to directly use std/http/file_server.ts as suggested in Deploy a static site tutorial.
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: https://deno.land/std/http/file_server.tsYou can specify an import map.
- name: Deploy to Deno Deploy
uses: denoland/deployctl@v1
with:
project: my-project
entrypoint: main.ts
import-map: path/to/import-map.json