Add public Forgejo static site deploy action
Some checks failed
Test / test (push) Failing after 15s
Some checks failed
Test / test (push) Failing after 15s
This commit is contained in:
commit
38ed25fb76
7 changed files with 521 additions and 0 deletions
40
action.yml
Normal file
40
action.yml
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
---
|
||||
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
|
||||
dry-run:
|
||||
description: Report changes without uploading or deleting files.
|
||||
required: false
|
||||
default: "false"
|
||||
|
||||
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 }}
|
||||
STATIC_SITE_DRY_RUN: ${{ inputs.dry-run }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
args=(bunny "$STATIC_SITE_DIRECTORY")
|
||||
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
|
||||
python3 "$FORGEJO_ACTION_PATH/static_site.py" "${args[@]}"
|
||||
Loading…
Reference in a new issue