You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use this action to deploy a Vercel project online through a GitHub action.
38
40
39
41
The action will return the url of the Vercel deployment _(and store it as environment variable, too)_, it will also apply domain aliases if there are any configured in the Vercel config file (`vercel.config` by default).
40
42
41
-
> It works quite differently compared to [`vercel-action`](https://github.com/marketplace/actions/vercel-action).
43
+
## Differences between `github-action-deploy-on-vercel` and `vercel-action`
44
+
45
+
This action works quite differently compared to [`vercel-action`](https://github.com/marketplace/actions/vercel-action).
46
+
47
+
> TL;DR: `vercel-action` is great if you don't need a lot of flexibility over the `vercel deploy` command.
48
+
> `github-action-deploy-on-vercel` is great if you need to run a custom command, such as a `npm/yarn` script.
49
+
50
+
`vercel-action`hides the `vercel deploy` command from you, and acts as a wrapper by providing its own API on top of it.
51
+
52
+
They simplify the `vercel` command by doing so. Unfortunately, they also reduce the flexibility available to the consumer (you).
53
+
54
+
In our case, we are dealing with multiple customers (B2B) which are **all sharing the same code base**.
55
+
The `vercel-action` was too limited and would have complicated our setup, because it requires additional information such as `project_id`/`org_id`.
56
+
57
+
For most project, we believe using `vercel-action` is enough, and we encourage you to use it, if you don't need to run a special `vercel deploy` command.
42
58
43
59
## Why/when should you use it?
44
60
45
-
You want to run a custom command that (amongst other things) performs a Vercel deployment.
61
+
You want to run a custom command that (amongst other things) performs a Vercel deployment and returns the URL of the Vercel deployment.
62
+
63
+
The URL of the deployment is often necessary to run follow-up actions, such as:
64
+
- Running End-to-End tests on the deployed site
65
+
- Running LightHouse tests on the deployed site
66
+
- Etc.
46
67
47
68
### Action's API
48
69
@@ -69,6 +90,7 @@ The below variables are available as outputs, but are also **injected as environ
69
90
Here are a few community-powered examples, those are usually advanced use-cases!
70
91
71
92
- [Next Right Now](https://github.com/UnlyEd/next-right-now) _(Disclosure: We're the author!)_
93
+
- [PR](https://github.com/UnlyEd/next-right-now/pull/296) - "Using this action helped us reduce a lot of **bash** code which was hardly testable." - _Next Right Now core contributors_
expect(execOutput.stderr.includes('Vercel CLI'),'Vercel binary might not have been installed, try installing it globally using "yarn global add vercel".').toBe(true);
* Globber is a github action tool https://github.com/actions/toolkit/tree/master/packages/glob
83
-
* It helps us to find the absolute path for a file. Indeed, because we don't know where the action will be run and we need to find this file, wherever it is.
84
-
*/
81
+
// Globber is a github action tool https://github.com/actions/toolkit/tree/master/packages/glob
82
+
// It helps us to find the absolute path for a file. Indeed, because we don't know where the action will be run and we need to find this file, wherever it is.
.catch((error)=>core.warning(`Did not receive JSON from Vercel API while creating aliases. Message: ${error===null||error===void0 ? void0 : error.message}`));
0 commit comments