26 lines
749 B
YAML
26 lines
749 B
YAML
name: 'Trigger Watchtower'
|
|
author: 'Bas Weelinck'
|
|
description: |
|
|
Wake up Watchtower by web request, so it will deploy any new images.
|
|
|
|
inputs:
|
|
watchtower_url:
|
|
description: 'URL where Watchtower is listening'
|
|
watchtower_token:
|
|
description: 'Bearer token for authenticating to Watchtower'
|
|
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Signal Watchtower
|
|
shell: bash
|
|
run: |
|
|
set -e
|
|
HTTP_CODE=$(curl -H "Authorization: Bearer ${{ inputs.watchtower_token }}" ${{ inputs.watchtower_url}}/v1/update -w '%{http_code}' -o /dev/null -s)
|
|
if [[ $HTTP_CODE == "200" ]]
|
|
then
|
|
echo 'Success!'
|
|
else
|
|
echo "Unexpected HTTP response code $HTTP_CODE"
|
|
exit 1
|
|
fi
|