Articles on: Guides

How to link Git Repositories with WordPress for automated QA Process?

Efficiently link Git repositories with WordPress for automated QA processes using InstaWP's integration with GitHub. By automatically creating and managing new instances upon Pull Request creation. It streamlines the QA workflow, facilitating seamless testing and deployment of WordPress projects with ease and precision.

In this guide, we will explore how to link repositories with WordPress for an automated QA process by:

Adding Deployment
Connecting with WordPress Site
Connecting with Snapshot

Let’s get started 🚀

Adding Deployment



Add a new deployment, enter the details of the Git repository, and link it with InstaWP. Let's try using the demonstration below.


Step 1: Sign in to the InstaWP account and go to Settings > Deployments page. Click Add New from the top right corner of your screen.




Step 2: Select a repository type. When selecting a private repository, paste the repository link and mention the branches and the destination folder for git deployments. Optionally, add post deploy commands that will be run after the git repository is cloned. For private repository, select SSH Key pair or generate one. Once done, click Add.





Connecting with WordPress Site



Connect Git repository to an existing site and deploy repository code to the site automatically. Using the demonstration below, let’s try to do that.


Step 1: Go to Sites and click on your site to open site settings page.





Step 2: Select Git Deployment from the options. Now, select the repository you have added to your account and click Save.




Step 3: Once saved, click on the copy icon to configure webhook with Git repository.




Step 4: Go to Git repository's webhook settings page i.e. Settings > Webhook. Then, click Add Webhook button.





Step 5: Paste the copied site's webhook URL on the Payload URL box. Select content type json and click Add Webhook.




Step 6: Select and edit the file that you want to commit changes.






👉 Now, you can check the changes on your site by entering on your site.







Connecting with Snapshot



Connect the Git repository to an existing snapshot, make changes and pull a new request to create new instances. Using the demonstration below, let’s try to do that.

👉 Note: Git deployment can be connected to private snapshots only.


Step 1: Go to Snapshot page and click on the vertical ellipsis of your snapshot. Select Enable Deployment.




Step 2: Select the git repository and click on the copy icon to configure webhook with git repository.




Step 3: Go to Git repository's webhook settings page i.e. Settings > Webhook. Then, click Add Webhook button.



Step 4: Paste the copied snapshot's webhook URL on the Payload URL box. Select content type json and click Add Webhook. This will connect snapshot webhook to Git repository.



Step 5: Now, generate an API token from your InstaWP account settings page. Go to API Token by clicking on Profile > Account. Set a name and give permission. Then, click Create.



Step 6: Copy the API token, once it is created.




Step 7: Now, add to the Git repository for auto creation of new instances on every pull requests. Go to your repository's setting page to add a new secret and API token.





Step 8: Select and edit the file that you want to commit changes with new branch.





This will create new pull request and a new site with your pull request content.


Updated on: 04/06/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!