mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Merge branch 'dev' into releases/v3
This commit is contained in:
commit
c5ddbe3b9b
51
README.md
51
README.md
@ -39,14 +39,61 @@ on:
|
||||
|
||||
#### Operating System Support 💿
|
||||
|
||||
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.
|
||||
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`.
|
||||
|
||||
```
|
||||
```yml
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
<details><summary>You can view an example of this pattern here.</summary>
|
||||
<p>
|
||||
|
||||
```yml
|
||||
name: Build and Deploy
|
||||
on: [push]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest # The first job utilizes windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Install # The project is built using npm and placed in the 'build' folder.
|
||||
run: |
|
||||
npm install
|
||||
npm run-script build
|
||||
|
||||
- name: Upload Artifacts # The project is then uploaded as an artifact named 'site'.
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: site
|
||||
path: build
|
||||
|
||||
deploy:
|
||||
needs: [build] # The second job must depend on the first one to complete before running, and uses ubuntu-latest instead of windows.
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v1
|
||||
|
||||
- name: Download Artifacts # The built project is downloaded into the 'site' folder.
|
||||
uses: actions/download-artifact@v1
|
||||
with:
|
||||
name: site
|
||||
|
||||
- name: Build and Deploy
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
with:
|
||||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
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.
|
||||
```
|
||||
</p>
|
||||
</details>
|
||||
|
||||
## Configuration 📁
|
||||
|
||||
|
@ -86,7 +86,7 @@ function deploy() {
|
||||
}
|
||||
// Checks out the base branch to begin the deployment process.
|
||||
yield util_1.execute(`git checkout ${constants_1.action.baseBranch || "master"}`, constants_1.workspace);
|
||||
yield util_1.execute(`git fetch origin`, constants_1.workspace);
|
||||
yield util_1.execute(`git fetch ${constants_1.repositoryPath}`, constants_1.workspace);
|
||||
yield util_1.execute(`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${constants_1.action.branch}`, constants_1.workspace);
|
||||
/*
|
||||
Pushes all of the build files into the deployment directory.
|
||||
|
@ -38,12 +38,12 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^24.0.23",
|
||||
"@types/node": "^12.12.11",
|
||||
"@types/node": "^12.12.14",
|
||||
"jest": "^24.8.0",
|
||||
"jest-circus": "^24.7.1",
|
||||
"lodash": "^4.17.15",
|
||||
"prettier": "^1.19.1",
|
||||
"ts-jest": "^24.0.2",
|
||||
"ts-jest": "^24.2.0",
|
||||
"tslint": "^5.20.0",
|
||||
"typescript": "^3.7.2"
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ export async function deploy(): Promise<any> {
|
||||
|
||||
// Checks out the base branch to begin the deployment process.
|
||||
await execute(`git checkout ${action.baseBranch || "master"}`, workspace);
|
||||
await execute(`git fetch origin`, workspace);
|
||||
await execute(`git fetch ${repositoryPath}`, workspace);
|
||||
await execute(
|
||||
`git worktree add --checkout ${temporaryDeploymentDirectory} origin/${action.branch}`,
|
||||
workspace
|
||||
|
12
yarn.lock
12
yarn.lock
@ -387,9 +387,9 @@
|
||||
dependencies:
|
||||
jest-diff "^24.3.0"
|
||||
|
||||
"@types/node@>= 8", "@types/node@^12.12.11":
|
||||
version "12.12.11"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.11.tgz#bec2961975888d964196bf0016a2f984d793d3ce"
|
||||
"@types/node@>= 8", "@types/node@^12.12.14":
|
||||
version "12.12.14"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.14.tgz#1c1d6e3c75dba466e0326948d56e8bd72a1903d2"
|
||||
|
||||
"@types/stack-utils@^1.0.1":
|
||||
version "1.0.1"
|
||||
@ -3074,9 +3074,9 @@ tr46@^1.0.1:
|
||||
dependencies:
|
||||
punycode "^2.1.0"
|
||||
|
||||
ts-jest@^24.0.2:
|
||||
version "24.1.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.1.0.tgz#2eaa813271a2987b7e6c3fefbda196301c131734"
|
||||
ts-jest@^24.2.0:
|
||||
version "24.2.0"
|
||||
resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-24.2.0.tgz#7abca28c2b4b0a1fdd715cd667d65d047ea4e768"
|
||||
dependencies:
|
||||
bs-logger "0.x"
|
||||
buffer-from "1.x"
|
||||
|
Loading…
Reference in New Issue
Block a user