Skip to content

Latest commit

 

History

History

deploy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

garden github-deploy

Execute a GitHub deployment based on a command that provides a URL (and optional log URL).

Usage

import { githubDeploy, netlifyDeploy } from '@zendeskgarden/scripts';

const args: {
  command: (...args: any[]) => Promise<string | { url: string; logUrl: string }>;
  production?: boolean;
  path?: string;
  token?: string;
  ref?: string;
  message?: string;
} = {
  command: async () => {
    const result = await netlifyDeploy({
      dir: __dirname,
      production: args.production,
      token: args.token,
      message: args.message
    });

    return result;
  }
  /* optional overrides */
};

(async () => {
  const url = await githubDeploy(args);

  console.log(url);
})();

Arguments

  • command deployment command to execute; returns a URL (or { url, logUrl } pair) if successful.
  • production determine whether this is a production or staging deployment; defaults to staging.
  • path optional path to a git directory; defaults to the current directory.
  • ref optional named branch, tag, or SHA to deploy against; defaults to the value provided by githubCommit.
  • token optional GitHub personal access token; defaults to the value provided by githubToken.
  • message optional deployment message.

Command

garden github-deploy \
       [--production] \
       [--path <path>] \
       [--commit <commit>] \
       [--token <token>] \
       [--message <message>] \
       <command>