Automated WordPress Code Review & Deployment using GitHub Actions

We have been working on GitHub Actions since January and weโ€™re excited to formally release our GitHub Actions Library today. ๐ŸŽ‰

GitHub Actions is currently in public beta so you may have to wait until you get access to this feature, before you can try it. You may apply for access. ๐Ÿคž

GitHub Actions Library ๐Ÿ“š

Weโ€™ve released three GitHub Actions

PHPCS Code Review ๐Ÿ‘จโ€๐Ÿ’ป

GitHub has a pull request review feature which is usually used to perform a manual code review. But GitHub has an API which not only reviews the pull request code chunks but also performs and submits line-by-line code review, automatically.

The fine folks at Automattic already use this API for VIP’s automated code review part and they are generous enough to release their review scripts under GPL. Automattic uses TeamCity but we decided to make their code review script work with GitHub Actions.

PHPCS Code Review GitHub Action performs automated code review on your WordPress or, for that matter, any PHP project using Automattic’s scripts and GitHub API.

๐Ÿ”—PHPCS Code Review setup and usage instructions

The inline comment by rtBot is part of automated code-review on this pull-request.

Deploy WordPress ๐Ÿš€

Once your pull request passes review, the changes in code needs to be deployed on the server also. The Deploy WordPress GitHub action automates this using Deployer.org tool. The advantage of using Deployer is that itโ€™s easy to rollback a deployment if something goes wrong.

This action requires your git repo layout to match our WordPress Skeleton. Since our skeleton is based on the VIP Go Skeleton, if you have a VIP Go site, there won’t be much changes required.

๐Ÿ”—Deploy WordPress setup and usage instructions

Sample Deploy WordPress Log

Slack Notify ๏ธ๐Ÿ””

This action is used to send a message in a Slack channel. It is generally used after deployment has completed notifying about deployment status.

๐Ÿ”—Slack Notify setup and usage instructions

Sample Slack Notification

ร€ la carte ๐Ÿฝ๏ธ

While we have released three GitHub Actions today and they work nicely together, you don’t need to use them all together.

If you are new to GitHub Actions, you may start with one and then move ahead. Slack Notify is the easiest to use while Deploy WordPress needs the most one-time setup effort.

We hope our GitHub Actions Library makes automated code review and deployment easier for your WordPress projects.

Stay tuned for more (GitHub) actions! ๐Ÿ‘‹

Link: rtCamp’s GitHub Actions Library

 

Leave a Reply