This GitHub Action automates the deployment of a script to Bunny.net Edge Scripting. Use this action to streamline your deployment process whenever changes are pushed to your repository.
Below is an example of how to configure this action to deploy a script 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@main
with:
script_id: ${{ secrets.SCRIPT_ID }}
deploy_key: ${{ secrets.DEPLOY_KEY }}
file: "script.ts"This action requires the following inputs:
- script_id (required): The ID of the script you want to deploy. This can be stored securely as a GitHub secret (SCRIPT_ID).
- deploy_key: The script deployment key used to authorize deployment. This should be stored securely as a GitHub secret (DEPLOY_KEY). If this is not filled, we'll try to use the Github Application to deploy the script. You'll need to associate your repository within Bunny.
- file (required): The script we are going to deploy.
To securely store your script_id and deploy_key, follow these steps:
- Navigate to your GitHub repository.
- Click on Settings > Secrets and variables > Actions.
- Click New repository secret.
- Add SCRIPT_ID and DEPLOY_KEY as secrets with the respective values.