Deploying your scripts with Github action

Deploying with the GitHub Action feature is designed to automate the deployment of scripts directly to bunny.net's Edge Scripting platform. This action ensures that your edge computing scripts are consistently and efficiently updated in response to changes within your codebase, particularly from specified branches in a GitHub repository.

By integrating this GitHub Action into your workflow, you can enhance the reliability of your deployment process and reduce the need for manual intervention, allowing you to focus on developing reliable, scalable applications for edge networks.

Example usage

The following GitHub workflow file example demonstrates how to configure this action to deploy a script automatically whenever there is a push to the main branch:

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@latest
        with:
          script_id: ${{ secrets.SCRIPT_ID }}
          deploy_key: ${{ secrets.DEPLOY_KEY }}
          file: "script.ts"

Inputs

To use this GitHub Action, you will need to provide the following inputs:
script_id (required):

  • The ID of the script you wish to deploy. This should be securely stored as a GitHub secret (SCRIPT_ID).
  • deploy_key: The deployment key used to authorize the deployment of the script. This should also be securely stored as a GitHub secret (DEPLOY_KEY).
  • file (required): The path of the script file that will be deployed. Ensure this file exists in your repository or that preceding actions generate it.

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


You should place the workflow file in the .github/workflows folder in your repository. You can adjust the workflow file to suit your own build and deployment pipeline. You can learn more about building workflows in the official GitHub documentation.

Setting up secrets

To ensure your script_id and deploy_key remain secure, follow these steps to store them 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.

Need help or encountered issues?

If you encounter any difficulties or have questions while following this guide, our support team is here to assist you. Please don't hesitate to contact us via the support request form for prompt assistance.
Our dedicated support team is ready to help you resolve any issues you might face during the deployment process, provide additional guidance, or answer your questions.