Skip to content

A github action to deploy a glob pattern to bunny.net storage and flush the associated pull zone made with effect-ts

Notifications You must be signed in to change notification settings

djang0dev/bunnynet-storage-deployer

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Bunny.net Storage Deployer

Bunny.net is a really cheap and functional content delivery platform that makes it easy to host content.

This action performs 3 operations.

  • Removes all the files from storage.
  • Uploads files and folders to storage.
  • Purges an associated pull zone.

Each operation can be activated with their respective upload, remove and purge flags.

Inputs

All the inputs are required except verbose

upload

It will upload files and folders if true provided.

remove

It will remove all the files from storage before uploading if "true" provided. storageZoneName and storagePassword inputs should be provided.

storageZoneName

The name of storage zone where you are connecting to.

storageEndpoint

The storage endpoint. Default value is storage.bunnycdn.com

storagePassword

The storage password. It should be read and write capable.

sourcePattern

The glob pattern to retrieve the files from, like ./dist/**/*.js

destination

The destination directory that should be uploaded to in the bunny storage zone. (Example: www). The destination should not have a trailing / as in www/.

If you want to upload files to a nested directory, you can specify the path to the directory in the destination parameter. For example, if you want to upload files to a directory called assets inside the www directory, you can set the destination parameter to www/assets.

Note that the nested directory will be automatically created by the CDN if it does not already exist.

purgePullZone

It will purge the pull zone if "true" provided. pullZoneId and apiKey inputs should be provided.

apiKey

The API key. You can retrieve your api key from your profile settings

pullZoneId

Pull zone ID. You can retrieve your pull zone id directly from here: https://dash.bunny.net/cdn/PULL_ZONE_ID/general/hostnames

verbose

Log more stuffs.

Example usage

- name: Deploy to Bunny.net
  uses: djang0dev/bunnynet-storage-deploy@v0
  with:
    upload: true
    remove: true
    storageName: ${{ secrets.BUNNY_STORAGE_NAME }}
    storageEndpoint: "storage.bunnycdn.com"
    storagePassword: ${{ secrets.BUNNY_STORAGE_PASSWORD }}
    destination: "test/"
    sourcePattern: "./dist/**/*.*"
    apiKey: ${{ secrets.BUNNY_API_KEY }}
    purgePullZone: true
    pullZoneId: ${{ secrets.BUNNY_PULL_ZONE_ID }}
    verbose: true

Refs

ayeressian/bunnycdn-storage-deploy - An equivalent, I got some issues with and I wanted to use a glob as source and learn some new effect tricks

TODO

  • Tests
  • Convert as CLI if needed

About

A github action to deploy a glob pattern to bunny.net storage and flush the associated pull zone made with effect-ts

Resources

Stars

Watchers

Forks

Packages

No packages published