Skip to content

Commit

Permalink
feature: add working dir input (#17)
Browse files Browse the repository at this point in the history
* feature: add working dir input

* docs: add readme doc
  • Loading branch information
foxundermoon authored and amondnet committed Jan 17, 2020
1 parent 7758a86 commit c334a92
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -49,6 +50,9 @@ async function nowDeploy () {
core.info(data.toString())
},
}
if(workingDirectory){
options.cwd = workingDirectory
}

return await exec.exec('npx', [
'now',
Expand Down

1 comment on commit c334a92

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for website ready!

Built with commit c334a92

https://zeit-now-deployment-action-14uw42xfe.now.sh

Please sign in to comment.