Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Here are all the inputs [deploy-to-vercel-action](https://github.com/BetaHuhn/de
| `VERCEL_PROJECT_ID` | Id of your Vercel project (more info [below](#vercel-project)) | **Yes** | N/A |
| `GITHUB_DEPLOYMENT` | Create a deployment on GitHub | **No** | true |
| `GITHUB_DEPLOYMENT_ENV` | Custom environment for the GitHub deployment. | **No** | `Production` or `Preview` |
| `PRODUCTION` | Create a production deployment on Vercel and GitHub | **No** | true (false for PR deployments) |
| `PRODUCTION` | Create a production deployment on Vercel and GitHub. | **No** | true (false for PR deployments) |
| `DELETE_EXISTING_COMMENT` | Delete existing PR comment when redeploying PR | **No** | true |
| `CREATE_COMMENT` | Create PR comment when deploying | **No** | true |
| `ATTACH_COMMIT_METADATA` | Attach metadata about the commit to the Vercel deployment | **No** | true |
Expand All @@ -94,8 +94,9 @@ Here are all the inputs [deploy-to-vercel-action](https://github.com/BetaHuhn/de
| `VERCEL_SCOPE` | Execute commands from a different Vercel team or user | **No** | N/A |
| `BUILD_ENV` | Provide environment variables to the build step | **No** | N/A |
| `WORKING_DIRECTORY` | Working directory for the Vercel CLI | **No** | N/A |
| `FORCE` | Used to skip the build cache. | **No** | false
| `PREBUILT` | Deploy a prebuilt Vercel Project. | **No** | false
| `FORCE` | Used to skip the build cache. | **No** | false |
| `PREBUILT` | Deploy a prebuilt Vercel Project. | **No** | false |
| `VERCEL_TARGET` | Specify a custom vercel environment target. Takes priority over `PRODUCTION`. | **No** | `Production` or `Preview` |

## 🛠️ Configuration

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ inputs:
description: |
Create a production deployment (default: true, false for PR deployments).
required: false
VERCEL_TARGET:
description: |
Specify a custom Vercel environment target, such as 'Production' or 'Preview'. Takes priority over PRODUCTION.
required: false
PREBUILT:
description: |
Deploy a prebuilt Vercel Project (default: false).
Expand Down
10 changes: 9 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15913,6 +15913,9 @@ const context = {
type: 'boolean',
default: !IS_PR
}),
VERCEL_TARGET: parser.getInput({
key: 'VERCEL_TARGET',
}),
GITHUB_DEPLOYMENT: parser.getInput({
key: 'GITHUB_DEPLOYMENT',
type: 'boolean',
Expand Down Expand Up @@ -16242,6 +16245,7 @@ const {
VERCEL_SCOPE,
VERCEL_ORG_ID,
VERCEL_PROJECT_ID,
VERCEL_TARGET,
SHA,
USER,
REPOSITORY,
Expand All @@ -16267,10 +16271,14 @@ const init = () => {
commandArguments.push(`--scope=${ VERCEL_SCOPE }`)
}

if (PRODUCTION) {
if (PRODUCTION && !VERCEL_TARGET) {
commandArguments.push('--prod')
}

if (VERCEL_TARGET) {
commandArguments.push(`--target=${ VERCEL_TARGET }`)
}

if (PREBUILT) {
commandArguments.push('--prebuilt')
}
Expand Down
3 changes: 3 additions & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const context = {
type: 'boolean',
default: !IS_PR
}),
VERCEL_TARGET: parser.getInput({
key: 'VERCEL_TARGET',
}),
GITHUB_DEPLOYMENT: parser.getInput({
key: 'GITHUB_DEPLOYMENT',
type: 'boolean',
Expand Down
7 changes: 6 additions & 1 deletion src/vercel.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const {
VERCEL_SCOPE,
VERCEL_ORG_ID,
VERCEL_PROJECT_ID,
VERCEL_TARGET,
SHA,
USER,
REPOSITORY,
Expand All @@ -33,10 +34,14 @@ const init = () => {
commandArguments.push(`--scope=${ VERCEL_SCOPE }`)
}

if (PRODUCTION) {
if (PRODUCTION && !VERCEL_TARGET) {
commandArguments.push('--prod')
}

if (VERCEL_TARGET) {
commandArguments.push(`--target=${ VERCEL_TARGET }`)
}

if (PREBUILT) {
commandArguments.push('--prebuilt')
}
Expand Down