Open Rattlyy opened 4 days ago
Hi, we support webhooks for dockerhub to automatically deploy when you push a new image
https://docs.dokploy.com/en/docs/core/application/overview#auto-deploy
@Siumauricio ghcr?
Researching looks like you can send a webhook on registry package, would you mind to try to use the webhooks in Github?
@Rattlyy
It seems that it is not possible with the current implementation, but there is another solution, which is to use the API directly I leave you the steps
the first request would look like this
curl -X 'POST' \
https://your-dokploy-domain/api/trpc/application.markRunning' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "YOUR-APPLICATION-ID"
}
}'
and then comes the one that does the deploying
curl -X 'POST' \
'https://your-dokploy-domain/api/trpc/application.deploy' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "YOUR-APPLICATION-ID"
}
}'
don't forget to generate the TOKEN to have access to the API and put your dokploy-domain
So your CI/CD should be something like this
name: Deploy Application
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Mark Application Running
run: |
curl -X 'POST' \
'https://your-dokploy-domain/api/trpc/application.markRunning' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "YOUR-APPLICATION-ID"
}
}'
- name: Deploy Application
run: |
curl -X 'POST' \
'https://your-dokploy-domain/api/trpc/application.deploy' \
-H 'accept: application/json' \
-H 'Authorization: Bearer YOUR-TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"json":{
"applicationId": "YOUR-APPLICATION-ID"
}
}'
What problem will this feature address?
Would love to see this feature, would be very useful :)
Describe the solution you'd like
Poll the registry for updates on X seconds or if a webhook system exists use that.
Describe alternatives you've considered
Github Actions, but sometimes I prefer to deploy straight from my pc so a registry autodeploy would be better.
Additional context
No response