Skip to content

GitHub branches and code deployments

Every WordPress and Node.js application on the VIP Platform is supplied with a GitHub repository within the wpcomvip GitHub organization.

Links to an application’s wpcomvip GitHub repository are located throughout the VIP Dashboard:

  • At the bottom of the navigation menu sidebar.
  • In the Overview panel.
  • In the Repository Management panel.

Applications are configured by default to deploy code from the wpcomvip GitHub repository to its environments. This “Default Deployment method” supports the widest range of platform features and enables the VIP Support team to supply pull requests on an as-need basis for security or performance-related hotfixes.

If your organization requires code to be developed in a repository other than the wpcomvip GitHub repository, you can enable the “Custom Deployment method” instead. When Custom Deployment is enabled, the code from the alternative repository can be deployed to a VIP Platform environment with VIP-CLI or a continuous deployment method.

Deployments

For environments that have Default Deployment enabled, commits that are pushed to its deploying wpcomvip GitHub repository branch—by direct commit or merged from a pull request—will always trigger an automatic code deployment.

Code deployments—initiated by either method (Custom or Default)—typically take up to 5 minutes to complete. The amount of time required to complete a code deployment can vary depending on the overall size of the codebase, the number of files within the codebase, Continuous Integration (CI) tasks or other build processes, and several other factors.

Updates on the progress of a code deployment and more detailed logs can be reviewed in the Deployments panel in the VIP Dashboard.

If you have an Org member role or an App write role for an application you will have access to view the complete Build logs for a single deployment or to use a rollback option to restore one of the recent deployments made to the environment.

For automated updates on the success or failure of a code deployment, you can configure Notifications to be sent to specific Destinations. Notifications can be sent to a webhook URL for Slack, Google Chat, or Microsoft Teams, a general-purpose webhook URL, or an email address.

Deploying branches

When Default Deployment is enabled, a specific branch of the application’s wpcomvip GitHub repository can be configured to deploy to each of an application’s environments. You can update the branch that deploys to an environment at any time in the Repository Management panel of the VIP Dashboard.

The CircleCI continuous integration service can be configured for a deploying branch. GitHub Actions are not an available option for your wpcomvip GitHub repository.

Busting the cache for concatenated files on deployment

By default, enqueued JavaScript and CSS files are concatenated for WordPress applications in order to reduce the number of requests that occur on a single page load. CSS files are minified as well as concatenated. The concatenated files are cached with a Cache-Control HTTP header set to cache-control: max-age=31536000 (1 year).

Filters are available to selectively code-disable file concatenation behavior for specific files.

The page cache does not automatically clear for an environment when a deployment occurs from your application’s GitHub repository. In general, flushing the page cache for an entire site or environment is strongly discouraged. The default behavior of the page cache is designed to protect the performance of a site and cached content will automatically refresh in 30 minutes or less.

Because the rendered HTML for a request is cached for up to 30 minutes, the references to updated concatenated files could be up to 30 minutes out of date unless the cache for those files is busted.

To bust the cache for concatenated files on deployment, the $ver value in the enqueue must be incrementally updated when changes are made to enqueued JS and CSS files. An updated $ver value effectively generates a new and unique static URL for the concatenated assets. 

Last updated: November 25, 2024