deploy-to-github-pages
Version:
A Node library that makes deploying a directory on a branch to GitHub pages easy and automatic.
23 lines (17 loc) • 543 B
JavaScript
const octokit = require('@octokit/rest')();
module.exports = { createDeployment, createDeploymentStatus };
function createDeployment(options) {
return withAuthentication(options)(octokit.repos.createDeployment);
}
function createDeploymentStatus(options) {
return withAuthentication(options)(octokit.repos.createDeploymentStatus);
}
function withAuthentication(options) {
return fn => {
authenticate(options);
return fn(options);
};
}
function authenticate({ token }) {
octokit.authenticate({ type: 'token', token });
}