Skip to content

Fix Bunny commands

Fix Bunny commands #18

name: Build and Deploy to Bunny CDN
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build Site
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Restore cache
uses: actions/cache@v4
with:
path: |
node_modules
.image-cache
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build with Node
run: |
npm ci
npx @11ty/eleventy
- name: Upload built site
uses: actions/upload-artifact@v4
with:
name: built-site
path: _site/
retention-days: 1
deploy:
name: Deploy to Bunny CDN
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Download built site
uses: actions/download-artifact@v4
with:
name: built-site
path: _site
- name: Deploy to Bunny CDN
run: |
npm install -g bnycdn
bnycdn key set default ${{ secrets.BUNNY_ACCESS_KEY }}
bnycdn key set chobble-blog ${{ secrets.BUNNY_STORAGE_ZONE_PASSWORD }} -t storages
bnycdn cp -s chobble-blog -R --from ./_site/ --to /
bnycdn pz purge -t 4583108