Another 1

This commit is contained in:
James Ives 2019-11-10 16:16:30 -05:00
parent fc94a2604d
commit c69e32bd1f
2 changed files with 19 additions and 9 deletions

View File

@ -17,6 +17,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const core = __importStar(require("@actions/core"));
const io_1 = require("@actions/io");
const util_1 = require("./util");
const constants_1 = require("./constants");
/** Generates the branch if it doesn't exist on the remote.
@ -93,11 +94,15 @@ function deploy() {
/*
Pushes all of the build files into the deployment directory.
Allows the user to specify the root if '.' is provided. */
/*await cp(`${action.build}/.`, temporaryDeploymentDirectory, {
recursive: true,
force: true
});*/
yield util_1.execute(`rsync -av --progress ${constants_1.action.build}/. ${temporaryDeploymentDirectory} --exclude .git ${constants_1.action.build === '.' && `--exclude ${temporaryDeploymentDirectory}`}`, constants_1.workspace);
if (constants_1.action.build === '.') {
yield util_1.execute(`rsync -av --progress ${constants_1.action.build}/. ${temporaryDeploymentDirectory} --exclude .git --exclude ${temporaryDeploymentDirectory}`, constants_1.workspace);
}
else {
yield io_1.cp(`${constants_1.action.build}/.`, temporaryDeploymentDirectory, {
recursive: true,
force: true
});
}
// Commits to GitHub.
yield util_1.execute(`git add --all .`, temporaryDeploymentDirectory);
yield util_1.execute(`git switch -c ${temporaryDeploymentBranch}`, temporaryDeploymentDirectory);

View File

@ -86,12 +86,17 @@ export async function deploy(): Promise<any> {
/*
Pushes all of the build files into the deployment directory.
Allows the user to specify the root if '.' is provided. */
/*await cp(`${action.build}/.`, temporaryDeploymentDirectory, {
recursive: true,
force: true
});*/
await execute(`rsync -av --progress ${action.build}/. ${temporaryDeploymentDirectory} --exclude .git ${action.build === '.' && `--exclude ${temporaryDeploymentDirectory}`}`, workspace)
if (action.build === '.') {
await execute(`rsync -av --progress ${action.build}/. ${temporaryDeploymentDirectory} --exclude .git --exclude ${temporaryDeploymentDirectory}`, workspace)
} else {
await cp(`${action.build}/.`, temporaryDeploymentDirectory, {
recursive: true,
force: true
});
}
// Commits to GitHub.
await execute(`git add --all .`, temporaryDeploymentDirectory);