Last active
September 27, 2020 22:03
-
-
Save richjava/ea0d447496ae5ec2c5c8319bbed1680c to your computer and use it in GitHub Desktop.
Create Netlify site from repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const netlifySitesUrl = `https://api.netlify.com/api/v1/sites`; | |
let netlifyRes = await axios.post( | |
netlifySitesUrl + `?access_token=${netlifyAccessToken}`, | |
{ | |
repo: { | |
provider: "github", | |
id: repoInfo.data.id, | |
repo: `${repoInfo.data.owner.login}/${repoInfo.data.name}`, | |
private: false, | |
branch: "master", | |
cmd: "npm run build", | |
dir: "public/", | |
deploy_key_id: netlifyRes.data.public_key, | |
env: { | |
API_ENDPOINT: | |
"..." | |
}, | |
}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment