Strapi v4 plugin to trigger and monitor multiple site deployments on Vercel.
Strapi v4 plugin to trigger and monitor multiple sites deployment on Vercel.
Home Page:
Settings Page:
Run the following command in your Strapi project to install vercel-deploy:
1yarn add @code-mancers/strapi-plugin-multi-site-vercel-deploy
2# or
3npm i -S @code-mancers/strapi-plugin-multi-site-vercel-deploy
Open config/plugins.js
file and add the vercel-deploy entry:
1module.exports = ({ env }) => ({
2 "multi-site-vercel-deploy": {
3 enabled: true,
4 },
5});
You can now run Strapi:
1yarn develop
You should see the Vercel Deploy menu in the left panel.
N.B. You may need to run yarn build
in order to see the new menu entries.
Then you can proceed with the plugin configuration.
Example:
1module.exports = ({ env }) => ({
2 "multi-site-vercel-deploy": {
3 enabled: true,
4 config: {
5 sites: [
6 {
7 deployHook:
8 "https://api.vercel.com/v1/integrations/deploy/prj_<deploy-hook>",
9 apiToken: "<vercel-api-token>",
10 appFilter: "your-app-name-on-vercel",
11 teamFilter: "your-team-id-on-vercel",
12 displayName: "app-name-to-be-displayed-in-dropdown",
13 },
14 ],
15 },
16 },
17});
The plugin is reading the following configuration variables to work:
deployHook
: Url of the git deploy hook exposed in Vercel.
apiToken
: API token of your Vercel account used to fetch the list of deployments
appFilter
: Name of your Vercel App used to filter the list of deployments
teamFilter
: Id of your Vercel Team used to filter the list of deployments
You shouldn't disclose the api token and the deploy hook url for security reasons. Therefore, you shouldn't add these values to versioning in a public git repository. A suggested solution is to use environment variables. Example:
1module.exports = ({ env }) => ({
2 "multi-site-vercel-deploy": {
3 enabled: true,
4 config: {
5 sites: [
6 {
7 deployHook: process.env.VERCEL_DEPLOY_PLUGIN_HOOK,
8 apiToken: process.env.VERCEL_DEPLOY_PLUGIN_API_TOKEN,
9 appFilter: process.env.VERCEL_DEPLOY_PLUGIN_APP_FILTER,
10 teamFilter: process.env.VERCEL_DEPLOY_PLUGIN_TEAM_FILTER,
11 displayName: process.env.VERCEL_DEPLOY_PLUGIN_DISPLAY_NAME,
12 },
13 ],
14 },
15 },
16});
For local development, you can add the config properties in your .env
file:
1VERCEL_DEPLOY_PLUGIN_HOOK="https://api.vercel.com/v1/integrations/deploy/prj_<deploy-hook>"
2VERCEL_DEPLOY_PLUGIN_API_TOKEN="<vercel-api-token>"
3VERCEL_DEPLOY_PLUGIN_APP_FILTER="your-app-name-on-vercel"
Thanks to gianlucaparadise for making strapi-plugin-vercel-deploy which this was based on.
npm install @code-mancers/strapi-plugin-multi-site-vercel-deploy
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.