> ## 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.

# Deploying your scripts with GitHub Actions

> Use the bunny.net deploy action to publish an Edge Script from a GitHub repository whenever your code changes.

The `BunnyWay/actions/deploy-script` action uploads a script to Edge Scripting as part of a GitHub workflow, so a push to the branch you choose publishes the script without anyone having to upload it by hand.

## Example usage

This workflow deploys a script whenever something is pushed to the main branch:

```yml theme={null}
name: Deploy when pushing on main

on:
  push:
    branches:
      - "main"

jobs:
  publish:
    runs-on: ubuntu-latest

    name: "Upload script"

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Deploy Script to Bunny Edge Scripting
        uses: BunnyWay/actions/deploy-script@main
        with:
          script_id: ${{ secrets.SCRIPT_ID }}
          deploy_key: ${{ secrets.DEPLOY_KEY }}
          file: "script.ts"
```

## Inputs

The action takes three inputs:

* `script_id` (required): the ID of the script you want to deploy. Store it as a GitHub secret (`SCRIPT_ID`).
* `deploy_key` (required): the key that authorizes the deployment. Store it as a GitHub secret (`DEPLOY_KEY`).
* `file` (required): the path of the script file to deploy. The file has to exist in your repository, or an earlier step in the workflow has to generate it.

The script ID and deploy key are available in the dashboard under **Script** -> **Deployments** -> **Settings**.

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

Place the workflow file in the `.github/workflows` folder in your repository, and adjust it to fit your own build and deployment pipeline. The [official GitHub documentation](https://docs.github.com/en/actions/writing-workflows) covers workflow syntax in full.

## Setting up secrets

To store the `script_id` and `deploy_key` as secrets in your GitHub repository:

1. Navigate to your GitHub repository.
2. Click on **Settings**.
3. Select **Secrets and variables**.
4. Choose **Actions**.
5. Click **New repository secret**.
6. Add `SCRIPT_ID` and `DEPLOY_KEY` as the names of the secrets and provide their respective values.
