We live in the age of agile workflows. Git is preferred over FTP. Especially with the advent of JAMstack and services like AWS Amplify and Netlify; developers only want to
git commit && git push and expect their products to be deployed globally.
It’s been a minute since I worked on a WordPress project, but for the last year or so, I’ve been fantasizing about a git-based plugin deployments workflow that will allow me to get away from those old SVN repositories finally.
I see dealing with SVN as a DevOps task. Something web developers should not be concerned with, in 2020. Web developers want to build websites. They want to use Git to do that. With JAMstack, everyone has become accustomed to the idea of pushing a git commit and getting the new build/release. That’s why I built WP Continuous Deployment.
wp-continuous-deployment to set up an instant GitHub to WordPress.org SVN deployment pipeline with incredibly powerful GitHub Actions. A true commit-deploy workflow with complex dev-ops done for you.
So, here it is. I just built one.
wp-continuous-deployment is a Node.js based CLI script. It automates everything you need to set up an instant, continuous deployment pipeline with GitHub Actions; for your WordPress plugins.
- Make sure your plugin is hosted on WordPress.org
- Put your WordPress plugin’s code in a GitHub Repo
- Clone the GitHub repo in your PC and browse it with command line
npx wp-console-deployment in root of the repo, you cloned
❯ ONE-TIME SETUP#
- Follow the instructions, set the slug of your plugin which is the last part of the URL, e.g., for my plugin wordpress.org/plugins/cf7-customizer/ the slug is
- Add you WordPress.org SVN username/password (it’s the same credentials you use for login.WordPress.org) in your plugin’s GitHub repository settings.
- Go to
https://github.com/owner/repo/settings/secrets make sure to change the
- Click Add New Secret add
SVN_USERNAME and fill the value with your username
- Click Add New Secret again; add
SVN_PASSWORD and fill the value with your password
- All your plugin assets must have been downloaded in the
.wordpress-org directory automatically
Or go to
https://ps.w.org/plugin-slug/ and then
assets directory (if it exists) to manually download the assets and place them
.wordpress-org directory (commit it to the GitHub repo)
- For every commit/push to master your assets & readme will get deployed (provided there are no other files were modified. If other files are changed the build will be canceled)
- For every new tag/push, a new version of the plugin will be deployed to the WordPress.org SVN repository.
- So, go ahead, make changes, git commit, and then run:
git tag 2.0.0 && git push --tags — considering 2.0.0 is the new version
❯ Read the changelog here →
🚀 RELEASE, and
I use Emoji-log, you should try it and simplify your git commits.
License & Conduct
Takeaway my professional opinion on open-source, developer relations, growing your business with family, and everything in between! Delivered to your inbox a couple of times every year. I'm even funny at times. I hate spam — pinky-promise!
👨💻👩💻 115,834 Developers Already Subscribed