The new GitHub Action I’ve set up will build a new downloadable copy of a WordPress theme when I create a new release or tag in its GitHub repository. In this regard, it’s still fired off by a manual action, but the uploaded file is automatically attached to the new release. This way I can create a new release and just concern myself with writing the description, without having to manually build the theme and upload its zip file.
My WordPress theme uses Justin Tadlock’s Mythic starter theme as its base. As such, it has both Composer and npm dependencies, both of which must be included for the theme to work. To that end, I’ve created a new GitHub Action called “Generate Installable Theme and Upload as Release Asset” to automate this process.
The final result is a zip file suitable for upload and installation in WordPress, which is then attached to the aforementioned release (or tag).
- DIY Deployments
Yaml File or Link to Code
Additional Resources / Info
I took inspiration from Leonardo Losoviz’s post on how he accomplished a similar process for a WordPress plugin. I probably would have had a more difficult time figuring this out without his code to learn from.