- Notifications
You must be signed in to change notification settings - Fork18
WordPress Plugin to trigger Vercel deploy hooks on command / update
License
aderaaij/wp-vercel-deploy-hooks
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
As I'm no longer working with WordPress, I have very little incentive to keep this plugin alive. If anyone would like to take over this plugin, please feel free to let me know and I'll gladly transfer the repository. Thank you!
A WordPress plugin to deploy a static site toVercel when you publish a new WordPress post/page, update a WordPress post/page or deploy on command from the WordPress admin menu and admin bar.
Based on the excellent WordPress PluginWP Netlify Webhook Deploy.
- 🚗 Deploy your Vercel project when publishing / updating a WordPress post
- 👉 Manually deploy your Vercel Project with the push of a button
- ⏲ Schedule deploys on a daily or weekly basis (mileage may vary).
You can install WP Vercel Deploy Hooks manually or through Composer
- Download the plugin as a
.zipfilefrom the repository - Login to your WordPress site and go to
Plugins -> Add new -> Upload plugin - Locate the
.zipfile on your machine, upload and activate
Composer allows you to install pacakges from a GitHub repository. This repository includes acomposer.json file which declares the package as a WordPress plugin. Include it in your project'scomposer.json as following:
..."repositories": [ {"type":"vcs","url":"https://github.com/aderaaij/wp-vercel-deploy-hooks.git" } ],"require": {"aderaaij/wp-vercel-deploy-hooks":"main" }...
Now the package will be included in the plugins folder when you usecomposer install/update.
To enable the plugin, you will need to create aDeploy Hook for your Vercel Project.
After you've created your deploy hook, navigate toDeploy -> Settings in the WordPress admin menu and paste your Vercel Deploy hook URL. On the settings page you can also activate deploys when you publish or update a post (disabled by default).
You can configure the Vercel Deploy Hook URL in your wp-config.php or other configuration file to be based on your environment using the constantWP_VERCEL_WEBHOOK_ADDRESS. An example follows:
switch (WP_ENVIRONMENT_TYPE) {case"live":case"production":define('WP_VERCEL_WEBHOOK_ADDRESS','https://api.vercel.com/v1/integrations/deploy/<sample>/<sample>' );break;case"test":case"staging":define('WP_VERCEL_WEBHOOK_ADDRESS','https://api.vercel.com/v1/integrations/deploy/<sample>/<sample>' );break;case"dev":case"development":define('WP_VERCEL_WEBHOOK_ADDRESS','https://api.vercel.com/v1/integrations/deploy/<sample>/<sample>' );break;case"local":define('WP_VERCEL_WEBHOOK_ADDRESS','https://api.vercel.com/v1/integrations/deploy/<sample>/<sample>' );break;}
Seehttps://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/ for more guidance on usingWP_ENVIRONMENT_TYPE
When you enable scheduling it callsthecron_schedules hook which depends on your site having visitors to be triggered. To make sure your schedule is triggered timely, you could schedule a CRON job in your hosting panel which callswp-cron.php. Please check out theWebhook Netlify Deploy scheduling documentation for more information.
This plugin was based on the excellent WordPress PluginWP Netlify Webhook Deploy
Made withcontrib.rocks.
- Add support for deploy and build statusses and updates through theVercel API
- Add support for Netlify Builds and Deploys
- Add support for multiple Vercel deploy endpoints
About
WordPress Plugin to trigger Vercel deploy hooks on command / update
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors11
Uh oh!
There was an error while loading.Please reload this page.