How to properly deploy WordPress to Kinsta?

Hi, I recently asked about deploying with DevKinsta but it seems this is not the right tool for a decent development workflow.

What are other options? is there any integration with GitHub or GitBucket that allows to deploy from a branch which contains the whole codebase? (including WP Core, Plugins and Theme files, but not user files like media uploads)

Thanks!

Hello @alvarofranz :wave:

There’s a way to use GitHub with DevKinsta and Kinsta. We have an article on that subject: Continuously deploy your WordPress site with GitHub Actions

This will allow you to have a granular push.

Let me know if that helps.

Kind regards!

I would have added this as a comment under the blog you linked to but think here might be better place for this conversation.

I’ve spent some time this morning trying to get this working but have hit a few hurdles and unknowns. Can you shed some light on these questions and blockers?

  • Once I pull down from Kinsta is it right that I can’t pull do a full sync again as it will just over-write everything including git folders. So this is in effect a one time deal. I know I can select which files/folders to pull down but would be lovely if that was initially from a ignore file or similar (with the option for me to over power that via the UI if needed) see Ability to Ignore Development Files From Syncing - #6 by Kevin

  • I have both a live and staging environment and would like these to update when I push to main or staging respectively. I’m happy to create two Github actions for this from the script provided and two lots of git hub secrets too however I hit a blocker with the SSH key step on the server. Both my environments already have a SSH key and its the same key between them. I don’t want to change it or overwrite is as I’m not sure if its used internally for Kinsta stuff at all. Can I use the same key for both environments? Or do I need to create a unique one per environment?

  • How can I sync up uploaded files etc from live using this setup? Would I use the DevKinsta UI as mentioned in my first point?

Cheers

Pete

Hello @Pete_Duncanson :wave:

I would like to answer each point you made separately.

  • The Kinsta pull is not the same as GitHub deployment cycle, therefore, .gitignore wouldn’t work in that case, you would have to manually select what you are pulling down from Kinsta.

  • As long as you’re setting the correct SSH port for Kinsta environments (the ports will be different) you shouldn’t have an issue using the existing key and you don’t have to generate a new one

  • GitHub actions might not be the best solutions for syncing upload files, because CI/CD is aimed towards continuous development of code, not the files/content

Based on your use cases described in this thread, using DevKinsta granular push/pull is still the only option from DevKinsta. You could also try rsync however, that would have to be done via SSH and it’s not a part of Kinsta interface.

I’m not sure what is the exact content that you need to pull down and then push back to live and staging servers and why do you need them locally (what actions are done on these files and/or database tables) so feel free to reply and if we have any workflow that would be compatible with DevKinsta, we would be happy to recommend it.

Kind regards

1 Like

Hi @VladimirM :slight_smile:

Firstly sorry for the multiposts, I couldn’t find the first one when I wrote this one so re-wrote it on yet another post! Lets just say it has been a long morning.

Thank you for your replies. Regarding your last point we have editors changing the banners for webpages, staff profiles etc. and I want to sometimes use these locally and on staging (to avoid the whole, “why doesn’;t this look like live?” questions when demo’ing new stuff). I hope that gives you some more context on my request for a partial sync. I could just FTP the media and upload folders down but wondered if there was a DevKinsta way to do it?

I’ve been using DevKinsta for about a year now as a solo dev but we we have another team member wanting to have a go hence we looking into git etc. more so its not just me doing all the coding while still allowing us to share our code etc. safely. Any pointers on multi dev setups well come.

Cheers

Pete

Hi @Pete_Duncanson Thank you for providing more context—it’s always helpful to understand the full picture, especially when it comes to workflows like yours.

With your query, you mentioned FTP for partial sync, but it isn’t supported for this use case. As far as I know, the only available options are the ones my colleague Vladimir has recommended. I understand that you will be working with a new team member soon and want to have a smoother workflow.

This is valuable input, and I’ll share it with our development team but cannot promise anything yet. We’ll be happy to share some tips too or resources if we find something similar to what you want to achieve.