feat: initial composite action for package-updater /update
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
name: "Deploy via package-updater"
|
||||
description: "Notifies package-updater to pull & restart a Docker Compose service"
|
||||
inputs:
|
||||
endpoint:
|
||||
description: "Full URL to /update (e.g. https://updater.example.com/update)"
|
||||
required: true
|
||||
image:
|
||||
description: "Image reference without tag (e.g. registry.example.com/myapp)"
|
||||
required: true
|
||||
tag:
|
||||
description: "Tag that was just pushed (for logging)"
|
||||
required: false
|
||||
default: ""
|
||||
token:
|
||||
description: "Bearer token for package-updater"
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Trigger update
|
||||
shell: bash
|
||||
env:
|
||||
TOKEN: ${{ inputs.token }}
|
||||
run: |
|
||||
response=$(curl -sS -w "\n%{http_code}" \
|
||||
-X POST "${{ inputs.endpoint }}" \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"image\":\"${{ inputs.image }}\",\"tag\":\"${{ inputs.tag }}\"}")
|
||||
body=$(echo "$response" | head -n -1)
|
||||
code=$(echo "$response" | tail -n 1)
|
||||
echo "HTTP $code"
|
||||
echo "$body" | jq .
|
||||
if [ "$code" -ge 400 ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user