mirror of
https://github.com/zhigang1992/now-deployment.git
synced 2026-04-28 20:15:31 +08:00
feature: add working dir input (#17)
* feature: add working dir input * docs: add readme doc
This commit is contained in:
13
README.md
13
README.md
@@ -77,3 +77,16 @@ jobs:
|
||||
zeit-team-id: team_XXXXXXXXXXX
|
||||
now-args: '--prod'
|
||||
```
|
||||
|
||||
|
||||
## specific working-directory
|
||||
|
||||
```yml
|
||||
- uses: amondnet/now-deployment@v1
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
zeit-token: ${{ secrets.ZEIT_TOKEN }}
|
||||
zeit-team-id: team_XXXXXXXXXXX
|
||||
now-args: '--prod'
|
||||
working-directory: ./sub-directory
|
||||
```
|
||||
@@ -18,6 +18,9 @@ inputs:
|
||||
required: false
|
||||
default: 'false'
|
||||
description: 'if you want to create github deployment, set true, default: false'
|
||||
working-directory:
|
||||
required: false
|
||||
description: the working directory
|
||||
|
||||
|
||||
outputs:
|
||||
|
||||
4
index.js
4
index.js
@@ -12,6 +12,7 @@ const zeitTeamId = core.getInput('zeit-team-id')
|
||||
const nowArgs = core.getInput('now-args')
|
||||
const githubToken = core.getInput('github-token')
|
||||
const githubDeployment = core.getInput('github-deployment')
|
||||
const workingDirectory = core.getInput('working-directory')
|
||||
|
||||
const zeitAPIClient = axios.create({
|
||||
baseURL: 'https://api.zeit.co', headers: {
|
||||
@@ -49,6 +50,9 @@ async function nowDeploy () {
|
||||
core.info(data.toString())
|
||||
},
|
||||
}
|
||||
if(workingDirectory){
|
||||
options.cwd = workingDirectory
|
||||
}
|
||||
|
||||
return await exec.exec('npx', [
|
||||
'now',
|
||||
|
||||
Reference in New Issue
Block a user