> ## Documentation Index
> Fetch the complete documentation index at: https://bunnynet-cb9733c2-add-new-partner-apis.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GitHub Integration

> Keep your Edge Script code in a GitHub repository and deploy it with GitHub Actions.

The GitHub integration lets you keep your Edge Script code in a GitHub repository instead of the dashboard editor. You get version control, and you can run the script through GitHub Actions before it ships: builds, tests, minification, security scanning, or anything else your pipeline needs. This suits larger applications, where the script is built from multiple files or prebuilt resources rather than written in a single editor tab.

## What you'll need

* A [bunny.net](https://bunny.net/) account ([log in](https://dash.bunny.net/auth/login?pk_buttonlocation=menu) or sign up for a [free trial](https://dash.bunny.net/auth/register)).
* A GitHub account.

## Creating a new repository

Start here if the project is new and you want to base it on a bunny.net template.

1. Login to the bunny.net dashboard.
2. Navigate to **Edge Platform** > **Scripting** and click **Add Script**.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/67f0ac06eb60d9f2e7bcfe49f7fe689a3bd45155a4fcb431923172c12a82e122-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=ad99d93eb749724297ae568242e666ef" alt="" width="1408" height="744" data-path="images/docs/67f0ac06eb60d9f2e7bcfe49f7fe689a3bd45155a4fcb431923172c12a82e122-image.png" />

3. Choose where the code lives. **Deploy and edit on Bunny.net** lets you write code directly in the browser and suits simple scripts. Select **Deploy and edit with GitHub** to keep the code in a GitHub repository.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/VGQSmK4NZjhav3kT/images/docs/4c633aa635c71ca5a4587cde6c284e77664ec14c081a643591c078701c3fc225-image.png?fit=max&auto=format&n=VGQSmK4NZjhav3kT&q=85&s=31d50de244742c446d9530a990df3bfc" alt="" width="1404" height="886" data-path="images/docs/4c633aa635c71ca5a4587cde6c284e77664ec14c081a643591c078701c3fc225-image.png" />

4. In the second step of script creation, fill in the **Script Name**.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/HDJ3Mo8hdY58eSDA/images/docs/fce102df7db0237f53c0b7c8ddbcd3683650997efa76b691e6c771bf4e551624-image.png?fit=max&auto=format&n=HDJ3Mo8hdY58eSDA&q=85&s=1f24ba65bc1d55471017be2d7de76d65" alt="" width="1418" height="346" data-path="images/docs/fce102df7db0237f53c0b7c8ddbcd3683650997efa76b691e6c771bf4e551624-image.png" />

5. Select between Standalone or Middleware script type. For more information, see our [Script Types documentation](/scripting).

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/a1f24d73bb4d2b69a77282030761e5bb36419ee969bc94afaf1da90f8a73a5d8-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=283de1dd988ca5edad660e7da22f2ab2" alt="" width="1422" height="498" data-path="images/docs/a1f24d73bb4d2b69a77282030761e5bb36419ee969bc94afaf1da90f8a73a5d8-image.png" />

6. Use the Repository section to connect the script with the GitHub repository. If you haven't connected your GitHub account yet, click Connect GitHub Account.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/9875891ba431d9019d9936c6e322e6d7191649942029810dbcc2e8b878f3e930-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=7fbac7ad87a62b8b4739366eec357886" alt="" width="1408" height="280" data-path="images/docs/9875891ba431d9019d9936c6e322e6d7191649942029810dbcc2e8b878f3e930-image.png" />

7. You will be redirected to the GitHub application permission page, where you can select the repositories that bunny.net can access.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/b49ea810738a3ba548ff9c935f58dbf764a18080ca3b9ac1ea4192761717353c-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=e28e8d5e65d1822b1b739875194bf177" alt="" width="1402" height="984" data-path="images/docs/b49ea810738a3ba548ff9c935f58dbf764a18080ca3b9ac1ea4192761717353c-image.png" />

8. Select **New Repository** to create a preconfigured repository based on a template.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/883188c29dd1e7b951edc19e6f895b680b2af36cfc18b8360e02e1a3fcbad366-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=13a131d9e956cf763fab3898e6f6f225" alt="" width="1412" height="506" data-path="images/docs/883188c29dd1e7b951edc19e6f895b680b2af36cfc18b8360e02e1a3fcbad366-image.png" />

9. Choose a script template. Each template is a starting setup for a different scenario. For demo purposes, you can choose the **Default empty script**.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/VGQSmK4NZjhav3kT/images/docs/3401a39467d544003dd71968803d98811c20e47c3294ce25ff59311f7061c32b-image.png?fit=max&auto=format&n=VGQSmK4NZjhav3kT&q=85&s=fe8d1e48011a23d5c5e7f1e7b0e47c17" alt="" width="1416" height="684" data-path="images/docs/3401a39467d544003dd71968803d98811c20e47c3294ce25ff59311f7061c32b-image.png" />

10. Click **Add Script**.

A new GitHub repository is created from the template, along with a workflow pipeline that deploys the build output to bunny.net Scripting. The pipeline runs straight away. This takes a few seconds, and you can watch it in the repository's Actions tab.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/HDJ3Mo8hdY58eSDA/images/docs/d6c147e33b08e9550748abad4cd2346079c4813f67b22e3bd4d39e83e7a5de4a-image.png?fit=max&auto=format&n=HDJ3Mo8hdY58eSDA&q=85&s=4042b34bc546771283e95037e34fa5d7" alt="" width="1412" height="654" data-path="images/docs/d6c147e33b08e9550748abad4cd2346079c4813f67b22e3bd4d39e83e7a5de4a-image.png" />

11. Your script is now live and ready to be invoked.

<Info>
  The provided templates are starting points for implementing your own application. Use the documentation available within the GitHub repository to learn how to extend it with your application logic, building custom functionality and features as needed.
</Info>

Once the script is live, the bunny.net dashboard shows how it is doing. You can see the number of requests it has served in real time, along with your production deployment: timestamps, version history, and deployment status. Execution logs are there too, which is where you go when something is failing or slower than you expected. Settings, script updates, and redeployment all happen from the same place.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/7980c971aabe77ef7d11c6409da195b9be79d89d6608fefe87b5150356dbd708-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=c290d0eff9d86339a532c782f930242a" alt="" width="1414" height="1122" data-path="images/docs/7980c971aabe77ef7d11c6409da195b9be79d89d6608fefe87b5150356dbd708-image.png" />

## Using an existing repository

Use this option when you already have a JavaScript or TypeScript project you want to deploy to Edge Scripting. The repository should be compatible with Edge Scripting, ideally built on Deno or Node.js, and structured so it can integrate with the Edge Scripting deployment GitHub action.

Setup matches the previous section. **Follow the steps in Creating a new repository up to Step 7**, then continue here:

1. Select **Existing Repository**.
2. Choose a repository from the list of your existing GitHub repositories. If the repository is not listed, ensure that the bunny.net GitHub app has the appropriate permissions.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/skVYlD6SY4HxvcnU/images/docs/afca99d115e11345ebdca25c6bf09f96672f5a2c47f771c7b9a261ab16189904-image.png?fit=max&auto=format&n=skVYlD6SY4HxvcnU&q=85&s=4c49932be43b4e6a5ba012baaa395ed2" alt="" width="1240" height="1502" data-path="images/docs/afca99d115e11345ebdca25c6bf09f96672f5a2c47f771c7b9a261ab16189904-image.png" />

3. Next, select a project preset based on the framework used in your project. If needed, adjust the **install command, build command**, and **entry file parameters**. A deployment workflow file will be automatically created in your existing repository based on these parameters. If you prefer to create the deployment workflow file yourself, select the **I will create the GitHub workflow file myself** option.
4. Your script is now live and ready to be invoked.

The dashboard gives you the same view as it does for a new repository: live request counts, deployment details and version history, execution logs, and the settings and redeploy controls.

<img src="https://mintcdn.com/bunnynet-cb9733c2-add-new-partner-apis/VGQSmK4NZjhav3kT/images/docs/29a3192d50245eb62811b2a91819dd80e5fd53fc7abb2d0d24b62558cbb8dce8-image.png?fit=max&auto=format&n=VGQSmK4NZjhav3kT&q=85&s=fbff2905bb21cd58b7a5b24d9d3b8bcb" alt="" width="1406" height="1112" data-path="images/docs/29a3192d50245eb62811b2a91819dd80e5fd53fc7abb2d0d24b62558cbb8dce8-image.png" />
