ci: add Drone pipeline, production Docker setup, frontend Dockerfile
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
30
.drone.yml
Normal file
30
.drone.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: production-deploy
|
||||
|
||||
# Trigger on every push to main
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
event:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: deploy
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: deploy_host
|
||||
username: root
|
||||
port: 22
|
||||
key:
|
||||
from_secret: deploy_ssh_key
|
||||
# Pull latest code, rebuild containers, reload Caddy
|
||||
script:
|
||||
- cd /opt/project-hub/src
|
||||
- git pull origin main
|
||||
- docker compose -f docker-compose.prod.yml up -d --build --force-recreate --remove-orphans
|
||||
- docker network connect pm-network caddy 2>/dev/null || true
|
||||
- docker exec caddy caddy reload --config /etc/caddy/Caddyfile --force
|
||||
- docker image prune -f
|
||||
- echo "Deploy complete."
|
||||
Reference in New Issue
Block a user