Hosting with Pantheon - ucsf-ckm/ucsf-library-ux-and-web-documentation GitHub Wiki
Migration
After seven years, we moved hosting for library.ucsf.edu
from Flywheel/WP Engine to Pantheon starting the end of Dec. 2022. The main reason was because UCSF has an account and many other campus sites are hosted there.
Overview
Pantheon is structured like this:
- Dev environment
- Test environment
- Live environment
see code vs content
- Code is writable in the Dev (or a Multidev) environment, but is locked in Test and Live. After changes are pushed to Dev, the Deploys panel in the Test tab will prompt you to commit the changes to Test
Combine Code from Dev and Content from Live in Test
- When you're ready to test a new set of changes, deploy your code from Dev to Test. At this point, you will be prompted to clone your content down from the Live environment.
- Deploying code from Test to Live will immediately update your public website
Workflow methods
WordPress dashboard
- Most day-to-day edits will be done via WordPress login in the Live environment. That includes all news posts, page content edits, etc. Custom CSS changes can be done here via the Simple CSS plugin.
Pantheon dashboard
- Code updates must be done in the Dev environment. This includes core, theme, and plugin updates. It does not include CSS changes, code snippets in the Snippets plugin, etc. Video
Autopilot
Autopilot automatically detects and applies CMS updates, including modules, plugins, and themes. Visual regression testing (VRT) checks for errors before deploying to your chosen environment.
SFTP or Git
- changes can also be done via Git, but switch back to SFTP to do app updates
Multidev
- how should this be used?
Updating core and plugins manually
- WordPress core: Pantheon Dev tab for
There are no updates This site is running the latest version of WordPress. When updates are available, they will appear here.
- Plugins: Pantheon dashboard for ucsf-library > Dev tab > Site Admin to get to WP dashboard and check updates. Once some are updated, return to Pantheon dashboard and write a good commit comment with list of plugins.
Plugin maintenance:
- Delete WP Migrate Lite
- Delete Yoast Test Helper
- Update Yoast SEO
- Update Auto Image Attributes From Filename With Bulk Updater
- Update Disable Comments
- Update Relevanssi
-
For some plugins and our theme, we float patches for accessibility fixes. If you've updated an item below, use the git command line to cherry-pick the relevant patch (
git checkout master && git pull && git cherry-pick <hash value from below>
), and then push the change to Pantheon (git push
).-
Elementor: 74e7062e1d0a817c255f72925c72839332be38e9, 0a9a33b39f38ff987a81e4bb72be2fd105e9c1a5, 91874cf51a557a56982994030353f310bb12445f, and eb2df19e05b5280644d3a5bc010e336becda349c
-
Elementor Pro: 8c482f9e4962d8d583463e6bb17a63ccae90e5d0, b68927c7a647b75ab366a3a799a0749b88e97c4f, and 49425dd5cc99b3a11607119c5c48d86a8e543e83
-
GeneratePress: 8333300fadbc33920ee85865d77b423c9e4d6e74
-
WPForms: 669dfdb93a8105d7dc3d8b67d76a8a7e37ed084b, b1f3b8db4a2be2a488b04093e99ee040cea7b74a, and 763d41002730caaef62269d66325698470aec7e8
-
If you're unsure of the process for these kinds of patches, you can watch a 4-minute video running through the process of updating plugins that require these kinds of patches
-
-
Go to Test tab and deploy what you just pushed including the same commit message. Do any testing before deploying on Live.
-
Go to Live tab and deploy what you just pushed, and it will push only the code to the live site. Same commit message.
Using Autopilot
Autopilot is a Pantheon feature that can automatically detect, perform, test, and deploy updates for WordPress. We've turned it on for the library website and configured it to automatically deploy the updates to the Dev
environment. Deployment of the updates to Test
and Live
is still done manually by anyone with the 'Team Member' or 'User in Charge' role for the Pantheon site ucsf-library
. To manage Autopilot and access its status/configuration pages, you must have the 'Administrator' role for the Pantheon workspace UCSF IT Web Services
. On our library team, only Zach Silveira has this role.
Workflow
- Autopilot checks for WordPress updates.
- Autopilot automatically deploys updates to
Multidev autopilot
and runs Visual Regression Testing (VRT) on the site. - If visual changes are below the acceptable level, Autopilot automatically deploys updates to
Dev
. If visual changes are above the acceptable level, Autopilot sends an email to the Administrator to review the flagged pages. Once the pages have been approved by the Administrator, Autopilot automatically deploys updates toDev
. - If updates include Elementor, Elementor Pro, GeneratePress, or WPForms, apply our a11y patches manually (see Updating core and plugins manually).
- Record changes in the Pantheon Deploy Log and deploy updates to
Test
. - Notify Slack channel
#backchannel-marketing-and-ux
of new updates to review on test server. - Record changes in the Pantheon Deploy Log and deploy updates to
Live
.
Autopilot Settings and Notes
These are the settings we've configured for our instance of Autopilot. They can be reconfigured if needed.
- Checks for: Upstream (core), plugin, and theme updates
- Frequency: Weekly (actually every five days)
- Final destination for automatic updates:
Dev
- VRT acceptable change: 1%
- VRT is currently done on 15 pages, but we can add more if desired
- We are not excluding any elements from VRT based on CSS selectors, but this is also an option