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

Skip to content

Commit c5ddbe3

Browse files
committed
Merge branch 'dev' into releases/v3
2 parents c89671e + 9464f67 commit c5ddbe3

File tree

5 files changed

+59
-12
lines changed

5 files changed

+59
-12
lines changed

README.md

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,61 @@ on:
3939

4040
#### Operating System Support 💿
4141

42-
This action is primarily developed using [Ubuntu](https://ubuntu.com/). [In your workflow job configuration](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on) it's reccomended to set the `runs-on` property to `ubuntu-latest`. Operating systems such as [Windows](https://www.microsoft.com/en-us/windows/) are not currently supported.
42+
This action is primarily developed using [Ubuntu](https://ubuntu.com/). [In your workflow job configuration](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idruns-on) it's reccomended to set the `runs-on` property to `ubuntu-latest`.
4343

44-
```
44+
```yml
4545
jobs:
4646
build-and-deploy:
4747
runs-on: ubuntu-latest
4848
```
4949

50+
Operating systems such as [Windows](https://www.microsoft.com/en-us/windows/) are not currently supported, however you can workaround this using [artifacts](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts). In your workflow configuration you can utilize the `actions/upload-artifact` and `actions/download-artifact` actions to move your project built on a Windows job to a secondary job that will handle the deployment.
51+
52+
<details><summary>You can view an example of this pattern here.</summary>
53+
<p>
54+
55+
```yml
56+
name: Build and Deploy
57+
on: [push]
58+
jobs:
59+
build:
60+
runs-on: windows-latest # The first job utilizes windows-latest
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v1
64+
65+
- name: Install # The project is built using npm and placed in the 'build' folder.
66+
run: |
67+
npm install
68+
npm run-script build
69+
70+
- name: Upload Artifacts # The project is then uploaded as an artifact named 'site'.
71+
uses: actions/upload-artifact@v1
72+
with:
73+
name: site
74+
path: build
75+
76+
deploy:
77+
needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows.
78+
runs-on: ubuntu-latest
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v1
82+
83+
- name: Download Artifacts # The built project is downloaded into the 'site' folder.
84+
uses: actions/download-artifact@v1
85+
with:
86+
name: site
87+
88+
- name: Build and Deploy
89+
uses: JamesIves/github-pages-deploy-action@releases/v3
90+
with:
91+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
92+
BRANCH: gh-pages
93+
FOLDER: 'site' # The deployment folder should match the name of the artifact. Even though our project builds into the 'build' folder the artifact name of 'site' must be placed here.
94+
```
95+
</p>
96+
</details>
5097

5198
## Configuration 📁
5299

lib/git.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function deploy() {
8686
}
8787
// Checks out the base branch to begin the deployment process.
8888
yield util_1.execute(`git checkout ${constants_1.action.baseBranch || "master"}`, constants_1.workspace);
89-
yield util_1.execute(`git fetch origin`, constants_1.workspace);
89+
yield util_1.execute(`git fetch ${constants_1.repositoryPath}`, constants_1.workspace);
9090
yield util_1.execute(`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${constants_1.action.branch}`, constants_1.workspace);
9191
/*
9292
Pushes all of the build files into the deployment directory.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
},
3939
"devDependencies": {
4040
"@types/jest": "^24.0.23",
41-
"@types/node": "^12.12.11",
41+
"@types/node": "^12.12.14",
4242
"jest": "^24.8.0",
4343
"jest-circus": "^24.7.1",
4444
"lodash": "^4.17.15",
4545
"prettier": "^1.19.1",
46-
"ts-jest": "^24.0.2",
46+
"ts-jest": "^24.2.0",
4747
"tslint": "^5.20.0",
4848
"typescript": "^3.7.2"
4949
}

src/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export async function deploy(): Promise<any> {
7676

7777
// Checks out the base branch to begin the deployment process.
7878
await 97AE execute(`git checkout ${action.baseBranch || "master"}`, workspace);
79-
await execute(`git fetch origin`, workspace);
79+
await execute(`git fetch ${repositoryPath}`, workspace);
8080
await execute(
8181
`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${action.branch}`,
8282
workspace

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@
387387
dependencies:
388388
jest-diff "^24.3.0"
389389

390-
"@types/node@>= 8", "@types/node@^12.12.11":
391-
version "12.12.11"
392-
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.11.tgz#bec2961975888d964196bf0016a2f984d793d3ce"
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"
393393

394394
"@types/stack-utils@^1.0.1":
395395
version "1.0.1"
@@ -3074,9 +3074,9 @@ tr46@^1.0.1:
30743074
dependencies:
30753075
punycode "^2.1.0"
30763076

3077-
ts-jest@^24.0.2:
3078-
version "24.1.0"
3079-
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.1.0.tgz#2eaa813271a2987b7e6c3fefbda196301c131734"
3077+
ts-jest@^24.2.0:
3078+
version "24.2.0"
3079+
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.2.0.tgz#7abca28c2b4b0a1fdd715cd667d65d047ea4e768"
30803080
dependencies:
30813081
bs-logger "0.x"
30823082
buffer-from "1.x"

0 commit comments

Comments
 (0)
0