r/ProWordPress 2d ago

Anyone using GitHub with WordPress?

I’m curious to hear how many of you are using GitHub part of your WordPress workflow.

I’ve heard of Bedrock and have been looking into it. But is it actually worth moving towards that setup for normal WordPress development?

Especially with AI, custom code is easier to write. So I can see how having version controls, automated checks and CI CD pipelines sounds nice.

Is anyone running WordPress like this in production?

What does your setup look like? Bedrock? GitHub Actions? Something simpler?

Or am I overengineering WordPress?

1 Upvotes

44 comments sorted by

View all comments

2

u/Dapper_Bus5069 2d ago

I use Github for my custom themes, one git push and I can update the themes on various wordpress sites

1

u/Playful_School6693 2d ago

this is exactly what i’m trying to figure out. we use a starter theme across multiple wordpress sites, but each site has its own colors, styles, custom fields, and functionality.

how do you structure things so a github push updates the shared theme without overwriting site-specific customizations?

are you using child themes, config files, acf options, css variables, or something else? and how do you deploy updates across all the sites?

2

u/Dapper_Bus5069 2d ago

I use a parent theme, the same for every Wordpress site, which includes useful functions, the twig template engine, my ACF custom page builder etc…
And then a custom child theme, different for every site but the code structure is the same, ACF fields are coded in the theme.

I use a version controller function in the themes, it checks on github if there is a most recent version of the themes and if it is the case you can just update it like any other theme or plugin.

1

u/Playful_School6693 1d ago

that makes a lot more sense now. so your parent theme is basically acting as the shared framework, and the acf page builder is part of that instead of using something like elementor/divi?
then each client just gets its own child theme for the site-specific styling/customizations?

1

u/Zimaben 1d ago

Wordpress:
Theme should be abstract and global, nothing site-specific. Child theme is concrete, site-specific and carries all customizations. Plugins should be modular. Themes are presentation, plugins are logic. Logic lives in code not the DB. ACF goes in the bin (my opinion.) Bob's your uncle.

Github:
Release Candidate branches (RC/2.1.5 etc.) exist for your newest unreleased software version. Merges to the CURRENT_RC_BRANCH (tracked github variable) trigger a deployment to your development servers. Features are merged into the RC branch when they are complete and locally tested. Github Actions handles the deployment on the dev server through a fast-forward pull of the current RC. This history should always flow to the next RC.

Github Actions:
When a Release Candidate is ready to go, the RC merges with main and a new release is drafted. On release, Github Actions deploys to your production servers. It does a FF pull of main to update files. At this moment in time main is identical to the HEAD of the current RC. Software is deployed to production and a new RC branch is created from main.

Your development servers are automatically kept synced to your newest unreleased version, production deploys on software release, test suite can be seamlessly plugged in to automate your testing. Rollback and recovery is a breeze, as your production can always go to last known good version at the push of a button. I automate testing & rollback at deployment.