API Management

Deploy to the edge - Editor

API Gateway tutorialLocal with an editorStep 4 of 5

Connect your project to GitHub so changes in your repository deploy to a hosted gateway.

Before you start: You need a Zuplo project, a GitHub account, and access to the repository you want to connect. Set up a basic gateway

In this guide we'll deploy your locally-developed gateway to the edge, at over 300 data-centers around the world. Zuplo deploys from Git source control — once your project is connected to a GitHub repository, every push deploys automatically, with no CI/CD configuration required.

The act of deployment creates new environments, so it's worth familiarizing yourself with how environments work.

To follow this tutorial, you need a GitHub account and a Zuplo account. Your local project directory must also be linked to a hosted Zuplo project in the Portal. The local files alone cannot receive a deployment.

  1. If you answered Yes when create-zuplo-api asked to create a matching Portal project, the CLI already created and linked its hosted project. Otherwise, from your local project directory, create one and link its working copy:

    TerminalCode
    npx zuplo project create --name example-project npx zuplo link

    Sign in and select your Zuplo account when prompted. If you already created a hosted project in the Portal, run only npx zuplo link and select that project and its working copy. See Creating a matching portal project.

  2. Check your project status

    From your project directory, run zuplo info to see how your local project maps to Zuplo:

    TerminalCode
    npx zuplo info
    TerminalCode
    Project: example-project Account: your-account Portal: https://portal.zuplo.com/your-account/example-project Environment Type: working-copy Source Control: none, connect at https://portal.zuplo.com/your-account/example-project/settings/source-control-settings

    Notice the Source Control line shows none — your project isn't connected to a repository yet. The next steps walk through connecting one so your changes deploy automatically.

  3. Create a GitHub repository

    In GitHub, create a new repository. Leave it empty — don't add a README, .gitignore, or license — since your project already contains those files.

  4. Push your project to GitHub

    create-zuplo-api already initialized your project as a Git repository. Stage and commit your work (if you haven't already), then point your local repo at the new GitHub repository and push:

    TerminalCode
    git add . git commit -m "Initial commit" git remote add origin https://github.com/your-account/example-project.git git branch -M main git push -u origin main
  5. Connect the repository in Zuplo

    Open the source-control settings link from the zuplo info output, or in the Zuplo Portal open Settings → Source Control.

    If this is your first time, click Connect to GitHub and authorize the Zuplo GitHub app — see GitHub Setup for a detailed walkthrough of the authorization flow and permissions.

    Once the app has access to your repositories, find the repository you just pushed to in the list and click Connect.

    Non-empty repository warning

    Because you already pushed your project, the portal will show a dialog warning that the repository isn't empty and that connecting will only create an association — no changes will be pushed or pulled automatically. That's exactly what we want here, so click Connect to proceed.

  6. Verify your deployment

    As soon as the repository is connected, Zuplo deploys your main branch. In GitHub you'll see a status check next to your commit; when it succeeds, the deployment links to your new environment.

    Run zuplo info again to confirm your project is now connected to source control:

    TerminalCode
    npx zuplo info

    Branch environments

    Every branch you push gets its own isolated environment. Create a development branch, push it, and Zuplo deploys a matching environment automatically. See Branch-Based Deployments to learn how branches map to environments.