feat: add custom commit message (#1136)

* feat: add custom commit message

Addresses: #1135

* Update publish-gh-pages.js

* add support to v2 as well

* docs: add them

* docs
This commit is contained in:
Jake Bolam 2018-12-03 23:26:21 -05:00 committed by Endilie Yacop Sucipto
parent cb1395ee29
commit c4a9b31984
3 changed files with 16 additions and 3 deletions

View file

@ -158,8 +158,10 @@ module.exports = async function deploy(siteDir) {
shell.cd(path.join('build', `${projectName}-${deploymentBranch}`));
shell.exec('git add --all');
const commitMessage =
process.env.CUSTOM_COMMIT_MESSAGE || 'Deploy website';
const commitResults = shell.exec(
`git commit -m "Deploy website" -m "Deploy website version based on ${currentCommit}"`,
`git commit -m "${commitMessage}" -m "Deploy website version based on ${currentCommit}"`,
);
if (shell.exec(`git push origin ${deploymentBranch}`).code !== 0) {
throw new Error('Error: Git push failed');