Add Watchtower trigger action definition.
This commit is contained in:
commit
5caa9025ce
1 changed files with 26 additions and 0 deletions
26
action.yml
Normal file
26
action.yml
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue