Skip to content

Commit

Permalink
feat: create github deployment
Browse files Browse the repository at this point in the history
Signed-off-by: Minsu Lee <amond@amond.net>
  • Loading branch information
amondnet committed Oct 13, 2020
1 parent d826954 commit fb24915
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1414,13 +1414,15 @@ function getEffectiveRef() {
async function createGithubDeployment() {
if (githubDeployment && octokit) {
core.debug(`Create a github deployment.`);
core.debug(`Current context :${github.context.action}`);
const deployment = await octokit.repos.createDeployment({
...context.repo,
ref: getEffectiveRef(),
environment: githubDeploymentEnv,
});
return deployment.id;
}
return null;
}

async function createGithubDeploymentStatus(deploymentId, state) {
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,15 @@ function getEffectiveRef() {
async function createGithubDeployment() {
if (githubDeployment && octokit) {
core.debug(`Create a github deployment.`);
core.debug(`Current context :${github.context.action}`);
const deployment = await octokit.repos.createDeployment({
...context.repo,
ref: getEffectiveRef(),
environment: githubDeploymentEnv,
});
return deployment.id;
}
return null;
}

async function createGithubDeploymentStatus(deploymentId, state) {
Expand Down

1 comment on commit fb24915

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for zeit-now-deployment-action-example-static ready!

✅ Preview
https://zeit-now-deployment-action-example-static-5v3jpw0wh.vercel.app
https://featuredeployment.static.vercel-action.amond.dev

Built with commit fb24915.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.