10000 Merge branch 'dev' into releases/v3 · cauu/github-pages-deploy-action@752f4c9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 752f4c9

Browse files
committed
Merge branch 'dev' into releases/v3
2 parents c5ddbe3 + 771cc5a commit 752f4c9

File tree

7 files changed

+43
-35
lines changed

7 files changed

+43
-35
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
This [GitHub action](https://github.com/features/actions) will handle the deploy process of your project to [GitHub Pages](https://pages.github.com/). It can be configured to upload your production-ready code into any branch you'd like, including `gh-pages` and `docs`.
66

77
## Getting Started :airplane:
8-
You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout` step before this workflow runs in order for the deployment to work.
8+
You can include the action in your workflow to trigger on any event that [GitHub actions supports](https://help.github.com/en/articles/events-that-trigger-workflows). If the remote branch that you wish to deploy to doesn't already exist the action will create it for you. Your workflow will also need to include the `actions/checkout@v1` step before this workflow runs in order for the deployment to work.
99

1010
You can view an example of this below.
1111

@@ -108,6 +108,7 @@ Below you'll find a description of what each option does.
108108
| `BRANCH` | This is the branch you wish to deploy to, for example `gh-pages` or `docs`. | `with` | **Yes** |
109109
| `FOLDER` | The folder in your repository that you want to deploy. If your build script compiles into a directory named `build` you'd put it here. **Folder paths cannot have a leading `/` or `./`**. If you wish to deploy the root directory you can place a `.` here. | `with` | **Yes** |
110110
| `BASE_BRANCH` | The base branch of your repository which you'd like to checkout prior to deploying. This defaults to `master`. | `with` | **No** |
111+
| `TARGET_FOLDER` | If you'd like to push the contents of the deployment folder into a specific directory on the deployment branch you can specify it here. | `with` | **No** |
111112
| `CLEAN` | If your project generates hashed files on build you can use this option to automatically delete them from the deployment branch with each deploy. This option can be toggled on by setting it to `true`. | `with` | **No** |
112113

113114
With the action correctly configured you should see the workflow trigger the deployment under the configured conditions.

lib/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports.action = {
2323
gitHubToken: core.getInput("GITHUB_TOKEN"),
2424
accessToken: core.getInput("ACCESS_TOKEN"),
2525
branch: core.getInput("BRANCH"),
26+
targetFolder: core.getInput("TARGET_FOLDER"),
2627
baseBranch: core.getInput("BASE_BRANCH") || "master",
2728
name: pusher && pusher.name
2829
? pusher.name

lib/git.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ function deploy() {
9292
Pushes all of the build files into the deployment directory.
9393
Allows the user to specify the root if '.' is provided.
9494
rysync is used to prevent file duplication. */
95-
yield util_1.execute(`rsync -q -av --progress ${constants_1.action.build}/. ${temporaryDeploymentDirectory} ${constants_1.action.clean ? `--delete --exclude CNAME --exclude .nojekyll` : ""} --exclude .git --exclude .github ${constants_1.action.build === constants_1.root ? `--exclude ${temporaryDeploymentDirectory}` : ""}`, constants_1.workspace);
95+
yield util_1.execute(`rsync -q -av --progress ${constants_1.action.build}/. ${constants_1.action.targetFolder
96+
? `${temporaryDeploymentDirectory}/${constants_1.action.targetFolder}`
97+
: temporaryDeploymentDirectory} ${constants_1.action.clean ? `--delete --exclude CNAME --exclude .nojekyll` : ""} --exclude .git --exclude .github ${constants_1.action.build === constants_1.root ? `--exclude ${temporaryDeploymentDirectory}` : ""}`, constants_1.workspace);
9698
const hasFilesToCommit = yield util_1.execute(`git status --porcelain`, temporaryDeploymentDirectory);
9799
if (!hasFilesToCommit && !constants_1.isTest) {
98100
console.log("There is nothing to commit. Exiting...");

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@
3333
"license": "MIT",
3434
"dependencies": {
3535
"@actions/core": "^1.2.0",
36-
"@actions/exec": "^1.0.1",
37-
"@actions/github": "^1.1.0"
36+
"@actions/exec": "^1.0.2",
37+
"@actions/github": "^2.0.0"
3838
},
3939
"devDependencies": {
4040
"@types/jest": "^24.0.23",
41-
"@types/node": "^12.12.14",
41+
"@types/node": "^12.12.17",
4242
"jest": "^24.8.0",
4343
"jest-circus": "^24.7.1",
4444
"lodash": "^4.17.15",
4545
"prettier": "^1.19.1",
4646
"ts-jest": "^24.2.0",
4747
"tslint": "^5.20.0",
48-
"typescript": "^3.7.2"
48+
"typescript": "^3.7.3"
4949
}
5050
}

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const action = {
1818
gitHubToken: core.getInput("GITHUB_TOKEN"),
1919
accessToken: core.getInput("ACCESS_TOKEN"),
2020
branch: core.getInput("BRANCH"),
21+
targetFolder: core.getInput("TARGET_FOLDER"),
2122
baseBranch: core.getInput("BASE_BRANCH") || "master",
2223
name:
2324
pusher && pusher.name

src/git.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ export async function deploy(): Promise<any> {
8787
Allows the user to specify the root if '.' is provided.
8888
rysync is used to prevent file duplication. */
8989
await execute(
90-
`rsync -q -av --progress ${
91-
action.build
92-
}/. ${temporaryDeploymentDirectory} ${
90+
`rsync -q -av --progress ${action.build}/. ${
91+
action.targetFolder
92+
? `${temporaryDeploymentDirectory}/${action.targetFolder}`
93+
: temporaryDeploymentDirectory
94+
} ${
9395
action.clean ? `--delete --exclude CNAME --exclude .nojekyll` : ""
9496
} --exclude .git --exclude .github ${
9597
action.build === root ? `--exclude ${temporaryDeploymentDirectory}` : ""

yarn.lock

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@
66
version "1.2.0"
77
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.0.tgz#aa5f52b26c362c821d41557e599371a42f6c0b3d"
88

9-
"@actions/exec@^1.0.1":
10-
version "1.0.1"
11-
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.1.tgz#1624b541165697e7008d7c87bc1f69f191263c6c"
9+
"@actions/exec@^1.0.2":
10+
version "1.0.2"
11+
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-1.0.2.tgz#80ae9c2ea0bf5d0046a9f73d2a1b15bddfff0311"
12+
dependencies:
13+
"@actions/io" "^1.0.1"
1214

13-
"@actions/github@^1.1.0":
14-
version "1.1.0"
15-
resolved "https://registry.yarnpkg.com/@actions/github/-/github-1.1.0.tgz#06f34e6b0cf07eb2b3641de3e680dbfae6bcd400"
15+
"@actions/github@^2.0.0":
16+
version "2.0.0"
17+
resolved "https://registry.yarnpkg.com/@actions/github/-/github-2.0.0.tgz#5b066b1a8747bbf48d47a058d9c241a2e37d5ee7"
1618
dependencies:
17-
"@octokit/graphql" "^2.0.1"
19+
"@octokit/graphql" "^4.3.1"
1820
"@octokit/rest" "^16.15.0"
1921

22+
"@actions/io@^1.0.1":
23+
version "1.0.1"
24+
resolved "https://registry.yarnpkg.com/@actions/io/-/io-1.0.1.tgz#81a9418fe2bbdef2d2717a8e9f85188b9c565aca"
25+
2026
"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.5.5":
2127
version "7.5.5"
2228
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d"
@@ -284,12 +290,13 @@
284290
is-plain-object "^3.0.0"
285291
universal-user-agent "^4.0.0"
286292

287-
"@octokit/graphql@^2.0.1":
288-
version "2.1.3"
289-
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-2.1.3.tgz#60c058a0ed5fa242eca6f938908d95fd1a2f4b92"
293+
"@octokit/graphql@^4.3.1":
294+
version "4.3.1"
295+
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.3.1.tgz#9ee840e04ed2906c7d6763807632de84cdecf418"
290296
dependencies:
291-
"@octokit/request" "^5.0.0"
292-
universal-user-agent "^2.0.3"
297+
"@octokit/request" "^5.3.0"
298+
"@octokit/types" "^2.0.0"
299+
universal-user-agent "^4.0.0"
293300

294301
"@octokit/request-error@^1.0.1", "@octokit/request-error@^1.0.2":
295302
version "1.2.0"
@@ -299,7 +306,7 @@
299306
deprecation "^2.0.0"
300307
once "^1.4.0"
301308

302-
"@octokit/request@^5.0.0", "@octokit/request@^5.2.0":
309+
"@octokit/request@^5.2.0", "@octokit/request@^5.3.0":
303310
version "5.3.1"
304311
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.3.1.tgz#3a1ace45e6f88b1be4749c5da963b3a3b4a2f120"
305312
dependencies:
@@ -387,9 +394,9 @@
387394
dependencies:
388395
jest-diff "^24.3.0"
389396

390-
"@types/node@>= 8", "@types/node@^12.12.14":
391-
version "12.12.14"
392-
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.14.tgz#1c1d6e3c75dba466e0326948d56e8bd72a1903d2"
397+
"@types/node@>= 8", "@types/node@^12.12.17":
398+
version "12.12.17"
399+
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.17.tgz#191b71e7f4c325ee0fb23bc4a996477d92b8c39b"
393400

394401
"@types/stack-utils@^1.0.1":
395402
version "1.0.1"
@@ -2385,7 +2392,7 @@ os-homedir@^1.0.0:
23852392
version "1.0.2"
23862393
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
23872394

2388-
os-name@^3.0.0, os-name@^3.1.0:
2395+
os-name@^3.1.0:
23892396
version "3.1.0"
23902397
resolved "https://registry.yarnpkg.com/os-name/-/os-name-3.1.0.tgz#dec19d966296e1cd62d701a5a66ee1ddeae70801"
23912398
dependencies:
@@ -3133,9 +3140,9 @@ type-check@~0.3.2:
31333140
dependencies:
31343141
prelude-ls "~1.1.2"
31353142

3136-
typescript@^3.7.2:
3137-
version "3.7.2"
3138-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb"
3143+
typescript@^3.7.3:
3144+
version "3.7.3"
3145+
resolved "https://regist 1C6A ry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69"
31393146

31403147
uglify-js@^3.1.4:
31413148
version "3.6.8"
@@ -3153,12 +3160,6 @@ union-value@^1.0.0:
31533160
is-extendable "^0.1.1"
31543161
set-value "^2.0.1"
31553162

3156-
universal-user-agent@^2.0.3:
3157-
version "2.1.0"
3158-
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-2.1.0.tgz#5abfbcc036a1ba490cb941f8fd68c46d3669e8e4"
3159-
dependencies:
3160-
os-name "^3.0.0"
3161-
31623163
universal-user-agent@^4.0.0:
31633164
version "4.0.0"
31643165
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16"

0 commit comments

Comments
 (0)
0