Execute a GitHub
deployment based on a
command that provides a URL (and optional log URL).
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);
})();commanddeployment command to execute; returns a URL (or{ url, logUrl }pair) if successful.productiondetermine whether this is a production or staging deployment; defaults to staging.pathoptional path to a git directory; defaults to the current directory.refoptional named branch, tag, or SHA to deploy against; defaults to the value provided bygithubCommit.tokenoptional GitHub personal access token; defaults to the value provided bygithubToken.messageoptional deployment message.
garden github-deploy \
[--production] \
[--path <path>] \
[--commit <commit>] \
[--token <token>] \
[--message <message>] \
<command>