Skip to content

Latest commit

 

History

History
67 lines (54 loc) · 2.08 KB

README.md

File metadata and controls

67 lines (54 loc) · 2.08 KB

deployctl GitHub Action

The Deno Deploy GitHub Action allows for easy deployment to Deno Deploy from a GitHub Actions workflow. This allows a simple way to have a build step before 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.

Usage

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 and choose the "GitHub Actions" deployment mode. You can do this in your project settings on https://dash.deno.com.

jobs:
  deploy:
    permissions:
      id-token: write # This is required to allow the GitHub Action to authenticate with Deno Deploy.
      contents: read
    steps:
      - name: Clone repository
        uses: actions/checkout@v3

      - name: Deploy to Deno Deploy
        uses: denoland/deployctl@v1
        with:
          project: my-project # the name of the project on Deno Deploy
          entrypoint: main.ts # the entrypoint to deploy

By default the entire contents of the repository will be deployed. This can be changed by specifying the root option.

- name: Deploy to Deno Deploy
  uses: denoland/deployctl@v1
  with:
    project: my-project
    entrypoint: index.js
    root: dist

The entrypoint can either be a relative path or file name, or a an absolute URL. If it is a relative path, it will be resolved relative to the root. Both absolute file:/// and https:// URLs are supported.

To deploy the ./dist directory using the std/http/file_server.ts module, you can use the following configuration:

- name: Deploy to Deno Deploy
  uses: denoland/deployctl@v1
  with:
    project: my-project
    entrypoint: https://deno.land/std/http/file_server.ts
    root: dist