Skip to content

Commit c1236a7

Browse files
authored
Create action.yml
1 parent 228b532 commit c1236a7

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

action.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Dokploy Deployment'
2+
description: 'Triggers a deployment in Dokploy via its API'
3+
4+
inputs:
5+
auth_token:
6+
description: 'Dokploy API Key for authentication'
7+
required: true
8+
application_id:
9+
description: 'The unique ID of the Dokploy application to deploy'
10+
required: true
11+
dokploy_url:
12+
descriptionn: 'The base URL of your Dokploy instance (e.g., https://dokploy.example.com).'
13+
required: true
14+
15+
runs:
16+
using: 'composite'
17+
steps:
18+
- name: Trigger Dokploy Deployment
19+
run: |
20+
curl -X 'POST' \
21+
"$DOKPLOY_URL/api/application.deploy" \
22+
-H 'accept: application/json' \
23+
-H 'Content-Type: application/json' \
24+
-H "x-api-key: $DOKPLOY_API_KEY" \
25+
-d "{\"applicationId\": \"$DOKPLOY_APPLICATION_ID\"}" \
26+
-w "%{http_code}" \
27+
-o /dev/null \
28+
-s)
29+
30+
if [ "$response" -ne 200 ]; then
31+
echo "Deployment failed with status code: $response"
32+
exit 1
33+
else
34+
echo "Deployment successful!"
35+
fi
36+
shell: bash
37+
env:
38+
DOKPLOY_URL: ${{ inputs.dokploy_url }}
39+
DOKPLOY_API_KEY: ${{ inputs.auth_token }}
40+
DOKPLOY_APPLICATION_ID: ${{ inputs.application_id }}

0 commit comments

Comments
 (0)