forked from benbristow/dokploy-deploy-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
39 lines (38 loc) · 1.12 KB
/
action.yml
File metadata and controls
39 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: 'Dokploy Deployment'
description: 'Trigger a Dokploy deployment'
branding:
icon: 'upload-cloud'
color: 'gray-dark'
inputs:
dokploy_url:
description: 'Dokploy base URL, e.g. https://dokploy.example.com'
required: true
api_key:
description: 'Dokploy API key'
required: true
application_id:
description: 'Dokploy application ID'
required: true
runs:
using: "composite"
steps:
- name: Trigger Dokploy deployment
shell: bash
env:
DOKPLOY_URL: ${{ inputs.dokploy_url }}
DOKPLOY_API_KEY: ${{ inputs.api_key }}
DOKPLOY_APPLICATION_ID: ${{ inputs.application_id }}
run: |
response=$(curl -X 'POST' \
"$DOKPLOY_URL/api/application.deploy" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H "x-api-key: $DOKPLOY_API_KEY" \
-d "{\"applicationId\": \"$DOKPLOY_APPLICATION_ID\"}" \
-w "%{http_code}" \
-o /dev/null \
-s)
if [ "$response" -ne 200 ]; then
echo "Deployment failed with status code: $response"
exit 1
fi