Skip to content

Commit

Permalink
Deploy Production Code for Commit f0e6e50 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Jul 20, 2022
1 parent f0e6e50 commit 13046b6
Show file tree
Hide file tree
Showing 12 changed files with 633 additions and 15 deletions.
2 changes: 2 additions & 0 deletions lib/constants.d.ts
Expand Up @@ -49,6 +49,8 @@ export interface ActionInterface {
tokenType?: string;
/** The folder where your deployment project lives. */
workspace: string;
/** GitHub tag name */
tag?: string | null;
}
/** The minimum required values to run the action as a node module. */
export interface NodeActionInterface {
Expand Down
3 changes: 2 additions & 1 deletion lib/constants.js
Expand Up @@ -92,7 +92,8 @@ exports.action = {
? true
: (0, core_1.getInput)('ssh-key'),
targetFolder: (0, core_1.getInput)('target-folder'),
workspace: process.env.GITHUB_WORKSPACE || ''
workspace: process.env.GITHUB_WORKSPACE || '',
tag: (0, core_1.getInput)('tag')
};
/** Status codes for the action. */
var Status;
Expand Down
11 changes: 9 additions & 2 deletions lib/git.js
Expand Up @@ -180,13 +180,20 @@ function deploy(action) {
pushResult.stdout.includes(`[remote rejected]`);
if (rejected)
(0, core_1.info)('Updates were rejected');
// If the push failed for any reason other than being rejected,
// If the push failed for any fatal reason other than being rejected,
// there is a problem
if (!rejected && pushResult.stderr)
if (!rejected && pushResult.stderr.trim().startsWith('fatal:'))
throw new Error(pushResult.stderr);
} while (rejected);
}
(0, core_1.info)(`Changes committed to the ${action.branch} branch… 📦`);
if (action.tag) {
(0, core_1.info)(`Adding '${action.tag}' tag to the commit…`);
yield (0, execute_1.execute)(`git tag ${action.tag}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
(0, core_1.info)(`Pushing '${action.tag}' tag to repository…`);
yield (0, execute_1.execute)(`git push origin ${action.tag}`, `${action.workspace}/${temporaryDeploymentDirectory}`, action.silent);
(0, core_1.info)(`Tag '${action.tag}' created and pushed to the ${action.branch} branch… 🏷️`);
}
return constants_1.Status.SUCCESS;
}
catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion node_modules/@types/node/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13046b6

Please sign in to comment.