GitHub Actions β
GitHub Actions is a popular continuous integration and delivery platform for automating your build, test, and deployment workflow. InstaWP allows you to auto-create new instances (and destroy them, optionally) when creating a new Pull Request (PR) on your GitHub repository.
In this documentation, we will explore the steps to:
Letβs get started π
Prerequisites Setup β
Step 1: Create a new staging site. Sign in to your InstaWP account and click on Add Site.

Step 2: Fill out the options according to your preferences and click Next Step.

Step 3: Select plugins according to your preference and click Create Site.

Step 4: Once created, click the Magic Login button.

Here, you can add new page, post or categories to the site.

Step 5: Save the site as a private snapshot. Go to the Sites page and click on the Save Template/Snapshot icon from your site.

Step 6: Set your snapshot name, Select Snapshot option, set the snapshot type as Private and click Save. This will save the site changes and create a new snapshot.

Step 7: Go to Deployments, enter the details of the WordPress plugin/theme repository. Select Add New from the deployments page.

Step 8: Select the repository type, then enter the repo URL, branch and destination folder. The URL format depends on the repository type β see below. Then, click Add.
| Public repository | Private repository | |
|---|---|---|
| Repo Type | Public | Private |
| Repo URL | HTTPS URL β on GitHub, Code > HTTPS | SSH URL only β on GitHub, Code > SSH |
| Authentication | None required | SSH key pair β select an existing one, or generate a new one |
| Extra step on GitHub | None | Copy the InstaWP SSH public key and add it to your repository under Settings β Deploy keys |

Public repository β
Copy the HTTPS URL from Code > HTTPS, paste it into InstaWP and click Add. No authentication or deploy key is needed β skip straight to Configure Advanced Options.
Private repository β
Copy the SSH URL from Code > SSH and paste it into InstaWP, then copy the SSH Key Pair InstaWP generates.

Go to your repository's settings page, add a new deploy key and paste the copied SSH public key.

Now, go back to InstaWP deployments and click Add. This will add the private Git repository to InstaWP.

Private repos β don't recreate the deployment
Regenerating a deployment mints a new SSH key pair, which invalidates the deploy key you already added on GitHub. Your workflow then fails with Permission denied (publickey). Re-add the current public key to GitHub's Deploy keys rather than recreating the deployment.
Configure Advanced Options β
Step 1: Go to Snapshots, connect the Git repository to the snapshot and paste this Yaml file into the repository. Click on the vertical ellipsis from your snapshot and click on Enable Deployment.
The new user needs to create a new file path (.github/workflows/.yml) for the Actions yml file onto their Git repository.

Step 2: Select the git repository and copy the yml file from the pop up window.

Step 3: Paste this actions yml file contents to your github workflow folder.

Step 4: Now, click Update from the Snapshot window.

Step 5: Generate and add an API token to Git repository. 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: Go to your repository's setting page to add a new secret and API token.

Perform Github Actions β
Step 1: Once advanced options are configured, select the repository file and make changes to it.
Make changes to repository
Step 2: Create a new branch and start a pull request. A new WordPress site will be created with the PR content.
Create a new branch and start pull request
| π‘ Did you know - On creating API token you can access the API via Postman, GitHub Actions. Learn about API tokens.
Related Articles β
- Add Deployment - Add a deployment first
- Run Deployment - Run a deployment
- Create a Site via API - Create sites via the API
- Manage API Tokens - Create and manage your API tokens