Skip to content

Connect to Template

After you have completed adding a deployment, you can connect it to an existing template. So, every time you have a new change in your Git branch you can create a new site off of the template and we will automatically pull the latest changes to your Git repo onto the new site.

In this documentation, we will explore the steps to connect a Git repository to a template.

Let’s get started 🚀

Before you connect: public or private repository?

The connection steps on this page — copying the template's webhook URL and adding it to your repository — are the same for both public and private repositories. What differs is how the deployment itself was configured on the Add Deployment screen. Get that right first, or the webhook will fire but sites created from the template will fail to pull your code.

Public repositoryPrivate repository
Repo TypePublicPrivate
Repo URLHTTPS URL — https://github.com/yourname/yourplugin.gitSSH URL only — git@github.com:yourname/yourplugin.git
AuthenticationNone requiredSSH key pair — select an existing one, or generate a new one
Extra step on GitHubNoneCopy the InstaWP SSH public key and add it to your repository under Settings → Deploy keys
WebhookRequired (Steps 3–4 below)Required (Steps 3–4 below)

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. Pulls then silently stop with Permission denied (publickey). If a template stops picking up your latest commits, re-add the current public key to GitHub's Deploy keys rather than recreating the deployment.

Connect a Git Repository to a Template

Step 1: Go to the Templates page and click on the template you want to enable deployment to enter the template dashboard.

Step 2: Click Git Deployment from the options and select your repository. Now, click the copy icon to configure the webhook with the Git Repository.

| Go to your GitHub repository, connect webhook and make Updates/Add features and Commit your changes in the branch. For more information, refer to GitHub Actions.

Step 3: Go to Git repository's webhook settings page and click Add webhook button.

Step 4: Paste the copied templates webhook URL on the Payload URL option. Then, select the content type json and click Add webhook button.

This will connect template webhook to Git Repository.

Step 5: Now, go to the repository file and edit it.

Step 6: Go back to the InstaWP Templates page and Save the repository list to an existing template on every push.

Create a Site From the Connected Template

Step 7: Now, create a new site from the template. Click the Create New Site icon.

Step 8: Choose temporary or reserve site and click Create Site button from the window.

Your site will be ready within a few seconds. Enter the site by clicking the link to see the Github changes to the site/plugin.

Now, you can view the GitHub repository in any of your code editors using Action yml file which shows that you have configured GitHub, InstaWP token, etc.

| 💡 Did you know - You can create a site from the template every time you have a new change in your Git branch. Learn about Github actions.

Docs are open — edit on GitHub. Built with VitePress.