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
95879b57c6
@ -208,7 +208,7 @@ jobs:
|
||||
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
|
||||
|
||||
- name: Deploy 🚀
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3-test
|
||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
||||
with:
|
||||
BASE_BRANCH: master
|
||||
BRANCH: gh-pages
|
||||
|
@ -2,10 +2,10 @@
|
||||
process.env['INPUT_FOLDER'] = 'build'
|
||||
process.env['GITHUB_SHA'] = '123'
|
||||
|
||||
import {mkdirP, rmRF} from '@actions/io'
|
||||
import {action} from '../src/constants'
|
||||
import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git'
|
||||
import {execute} from '../src/execute'
|
||||
import {rmRF} from '@actions/io'
|
||||
import {deploy, generateBranch, init, switchToBaseBranch} from '../src/git'
|
||||
|
||||
const originalAction = JSON.stringify(action)
|
||||
|
||||
@ -17,7 +17,8 @@ jest.mock('@actions/core', () => ({
|
||||
}))
|
||||
|
||||
jest.mock('@actions/io', () => ({
|
||||
rmRF: jest.fn()
|
||||
rmRF: jest.fn(),
|
||||
mkdirP: jest.fn()
|
||||
}))
|
||||
|
||||
jest.mock('../src/execute', () => ({
|
||||
@ -402,6 +403,7 @@ describe('git', () => {
|
||||
|
||||
expect(execute).toBeCalledTimes(11)
|
||||
expect(rmRF).toBeCalledTimes(1)
|
||||
expect(mkdirP).toBeCalledTimes(1)
|
||||
})
|
||||
|
||||
it('should stop early if there is nothing to commit', async () => {
|
||||
|
14
package.json
14
package.json
@ -2,7 +2,7 @@
|
||||
"name": "github-pages-deploy-action",
|
||||
"description": "GitHub action for building a project and deploying it to GitHub pages.",
|
||||
"author": "James Ives <iam@jamesiv.es> (https://jamesiv.es)",
|
||||
"version": "3.4.7",
|
||||
"version": "3.4.8",
|
||||
"license": "MIT",
|
||||
"main": "lib/lib.js",
|
||||
"types": "lib/lib.d.ts",
|
||||
@ -34,21 +34,21 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@actions/core": "1.2.3",
|
||||
"@actions/exec": "1.0.3",
|
||||
"@actions/exec": "1.0.4",
|
||||
"@actions/github": "2.1.1",
|
||||
"@actions/io": "1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "25.2.1",
|
||||
"@types/node": "13.11.1",
|
||||
"@types/node": "13.13.4",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-plugin-github": "3.4.1",
|
||||
"eslint-plugin-jest": "23.8.2",
|
||||
"eslint-plugin-prettier": "^3.1.2",
|
||||
"jest": "25.3.0",
|
||||
"jest-circus": "25.3.0",
|
||||
"prettier": "2.0.4",
|
||||
"ts-jest": "25.3.1",
|
||||
"jest": "25.5.0",
|
||||
"jest-circus": "25.5.1",
|
||||
"prettier": "2.0.5",
|
||||
"ts-jest": "25.4.0",
|
||||
"typescript": "3.8.3"
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {info} from '@actions/core'
|
||||
import {rmRF} from '@actions/io'
|
||||
import {rmRF, mkdirP} from '@actions/io'
|
||||
import {ActionInterface} from './constants'
|
||||
import {execute} from './execute'
|
||||
import {
|
||||
@ -147,6 +147,11 @@ export async function deploy(action: ActionInterface): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
if (action.targetFolder) {
|
||||
info(`Creating target folder if it doesn't already exist… 📌`)
|
||||
await mkdirP(`${temporaryDeploymentDirectory}/${action.targetFolder}`)
|
||||
}
|
||||
|
||||
/*
|
||||
Pushes all of the build files into the deployment directory.
|
||||
Allows the user to specify the root if '.' is provided.
|
||||
|
Loading…
Reference in New Issue
Block a user