mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Another 1
This commit is contained in:
parent
fc94a2604d
commit
c69e32bd1f
15
lib/git.js
15
lib/git.js
@ -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);
|
||||
|
13
src/git.ts
13
src/git.ts
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user