2026-07-15 16:18:50 +02:00
|
|
|
---
|
|
|
|
|
name: Deploy static site to Bunny
|
|
|
|
|
description: Safely synchronize a completed static website build to Bunny Storage.
|
|
|
|
|
|
|
|
|
|
inputs:
|
|
|
|
|
directory:
|
|
|
|
|
description: Directory containing the completed static build and index.html.
|
|
|
|
|
required: true
|
|
|
|
|
storage-zone:
|
|
|
|
|
description: Bunny Storage Zone name.
|
|
|
|
|
required: true
|
|
|
|
|
storage-endpoint:
|
|
|
|
|
description: Regional Bunny Storage API hostname.
|
|
|
|
|
required: false
|
|
|
|
|
default: storage.bunnycdn.com
|
2026-07-17 19:50:31 +02:00
|
|
|
purge-endpoint:
|
2026-07-21 23:26:34 +02:00
|
|
|
description: Optional trusted Gandalf deployment gateway base URL.
|
2026-07-17 19:50:31 +02:00
|
|
|
required: false
|
|
|
|
|
default: ""
|
2026-10-02 17:14:42 +02:00
|
|
|
edge-rules:
|
|
|
|
|
description: >-
|
2026-10-02 23:57:33 +02:00
|
|
|
Optional bunny.toml with the site's [[edge_rules]] (redirects, status
|
|
|
|
|
codes, headers, cache times) and [site] settings (not_found). Needs
|
|
|
|
|
purge-endpoint. Through the gateway, leaving it empty removes rules and
|
|
|
|
|
resets settings that earlier deployments declared.
|
2026-10-02 17:14:42 +02:00
|
|
|
required: false
|
|
|
|
|
default: ""
|
2026-07-15 16:18:50 +02:00
|
|
|
dry-run:
|
|
|
|
|
description: Report changes without uploading or deleting files.
|
|
|
|
|
required: false
|
|
|
|
|
default: "false"
|
2026-07-20 02:02:47 +02:00
|
|
|
workers:
|
|
|
|
|
description: Maximum concurrent Bunny Storage transfers.
|
|
|
|
|
required: false
|
|
|
|
|
default: "16"
|
2026-07-15 16:18:50 +02:00
|
|
|
|
|
|
|
|
runs:
|
|
|
|
|
using: composite
|
|
|
|
|
steps:
|
|
|
|
|
- name: Synchronize static build
|
|
|
|
|
shell: bash
|
|
|
|
|
env:
|
|
|
|
|
STATIC_SITE_DIRECTORY: ${{ inputs.directory }}
|
|
|
|
|
BUNNY_STORAGE_ZONE: ${{ inputs.storage-zone }}
|
|
|
|
|
BUNNY_STORAGE_ENDPOINT: ${{ inputs.storage-endpoint }}
|
2026-07-17 19:50:31 +02:00
|
|
|
BUNNY_PURGE_ENDPOINT: ${{ inputs.purge-endpoint }}
|
2026-07-21 23:26:34 +02:00
|
|
|
STATIC_SITE_REVISION: ${{ github.sha }}
|
2026-07-15 16:18:50 +02:00
|
|
|
STATIC_SITE_DRY_RUN: ${{ inputs.dry-run }}
|
2026-07-20 02:02:47 +02:00
|
|
|
STATIC_SITE_WORKERS: ${{ inputs.workers }}
|
2026-10-02 17:14:42 +02:00
|
|
|
STATIC_SITE_EDGE_RULES: ${{ inputs.edge-rules }}
|
2026-07-15 16:18:50 +02:00
|
|
|
run: |
|
|
|
|
|
set -euo pipefail
|
2026-07-20 02:02:47 +02:00
|
|
|
args=(bunny "$STATIC_SITE_DIRECTORY" --workers "$STATIC_SITE_WORKERS")
|
2026-07-15 16:18:50 +02:00
|
|
|
if [[ "$STATIC_SITE_DRY_RUN" == "true" ]]; then
|
|
|
|
|
args+=(--dry-run)
|
|
|
|
|
elif [[ "$STATIC_SITE_DRY_RUN" != "false" ]]; then
|
|
|
|
|
echo "dry-run must be true or false" >&2
|
|
|
|
|
exit 2
|
|
|
|
|
fi
|
2026-10-02 23:29:58 +02:00
|
|
|
# Forgejo and GitHub name the action's checkout differently.
|
|
|
|
|
python3 "${FORGEJO_ACTION_PATH:-$GITHUB_ACTION_PATH}/static_site.py" "${args[@]}"
|