feature: add working dir input (#17)

* feature: add working dir input

* docs: add readme doc
This commit is contained in:
foxundermoon
2020-01-17 23:52:00 +08:00
committed by amond
parent 7758a86df8
commit c334a921c0
3 changed files with 20 additions and 0 deletions

View File

@@ -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
```

View File

@@ -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:

View File

@@ -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',