chromart-gitea-actions/.gitea/workflows/gitainer-deploy.yaml
Martin Dimitrov b9b7537c3f
Some checks failed
Reload Act Runner Stack to clear cache for workflows / diff (push) Successful in 1m27s
Reload Act Runner Stack to clear cache for workflows / reload-primary (push) Successful in 4s
Reload Act Runner Stack to clear cache for workflows / reload-secondary (push) Successful in 59s
Reload Act Runner Stack to clear cache for workflows / pull-cache-secondary (push) Failing after 1m0s
timeout curl
2026-03-07 12:41:04 -08:00

44 lines
1.6 KiB
YAML

name: Reload Gitainer Stack
on:
workflow_call:
inputs:
stack_name:
required: true
type: string
delayed_silent:
description: Delay the webhook call using a detached container and always succeed. Used when rebuilding the runner executing the webhook.
required: false
type: boolean
default: false
runs_on_label:
description: The runner label to execute this workflow on.
required: false
type: string
default: ubuntu-22.04
webhook_timeout:
description: Maximum time in seconds that curl will allow the Gitainer API webhook to take before failing.
required: false
type: number
default: 300
jobs:
deploy-gitainer:
runs-on: ${{ inputs.runs_on_label }}
steps:
- name: Check status step
id: check-step
if: success()
run: echo "Workflow successful"
- name: Call Gitainer stack webhooks
continue-on-error: true
run: |
if [ "${{ inputs.delayed_silent }}" = "true" ]; then
echo "Delaying the webhook call by 10s using a detached container."
echo "This gives the runner time to report job completion and clean up before it restarts."
docker run --rm -d alpine sh -c "apk add --no-cache curl && sleep 10 && curl --max-time ${{ inputs.webhook_timeout }} --request POST 'http://192.168.1.150:9080/api/stacks/${{ inputs.stack_name }}?pretty'"
else
curl --max-time ${{ inputs.webhook_timeout }} --request POST "http://192.168.1.150:9080/api/stacks/${{ inputs.stack_name }}?pretty"
fi