Canonical shell-only composite actions: deploy-pages, docker-publish, forgejo-release
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
8b0ef6d709
4 changed files with 301 additions and 0 deletions
33
deploy-pages/action.yml
Normal file
33
deploy-pages/action.yml
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
name: Deploy to pages mount
|
||||
description: >-
|
||||
rsync a built directory into the host /pages mount that nginx serves.
|
||||
Pure shell — depends on no marketplace actions.
|
||||
|
||||
inputs:
|
||||
source:
|
||||
description: Source directory whose *contents* are synced (a trailing slash is added automatically).
|
||||
required: true
|
||||
target:
|
||||
description: Subdirectory under /pages to deploy into, e.g. "photos" -> /pages/photos.
|
||||
required: true
|
||||
delete:
|
||||
description: Delete files in the target that are absent from the source ("true"/"false").
|
||||
default: "true"
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: rsync to /pages
|
||||
shell: bash
|
||||
env:
|
||||
SOURCE: ${{ inputs.source }}
|
||||
TARGET: ${{ inputs.target }}
|
||||
DELETE: ${{ inputs.delete }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
command -v rsync >/dev/null 2>&1 || { apt-get update && apt-get install -y --no-install-recommends rsync; }
|
||||
del=""
|
||||
[ "$DELETE" = "true" ] && del="--delete"
|
||||
# Trailing slash on the source => copy its contents, not the dir itself.
|
||||
src="${SOURCE%/}/"
|
||||
rsync -a $del --mkpath "$src" "/pages/${TARGET}/"
|
||||
Loading…
Add table
Add a link
Reference in a new issue