mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 07:35:42 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cb23464e5 |
@@ -122,6 +122,16 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Copy config files to server
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: ${{ secrets.DO_DROPLET_IP }}
|
||||
username: deploy
|
||||
key: ${{ secrets.DO_SSH_KEY }}
|
||||
source: "nginx/nginx.conf,docker-compose.prod.yml"
|
||||
target: "/opt/eagle0"
|
||||
strip_components: 0
|
||||
|
||||
- name: Deploy auth service to production
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
with:
|
||||
@@ -199,17 +209,10 @@ jobs:
|
||||
# Show container status
|
||||
docker compose -f docker-compose.prod.yml ps auth
|
||||
|
||||
# Update nginx config and restart only if changed
|
||||
echo "=== Checking for nginx config changes ==="
|
||||
git fetch origin main
|
||||
if ! git diff --quiet HEAD origin/main -- nginx/nginx.conf docker-compose.prod.yml; then
|
||||
echo "Config files changed, updating and restarting nginx..."
|
||||
git checkout origin/main -- nginx/nginx.conf docker-compose.prod.yml
|
||||
docker compose -f docker-compose.prod.yml up -d --no-deps --force-recreate nginx
|
||||
echo "Nginx restarted with updated config"
|
||||
else
|
||||
echo "No nginx config changes, skipping restart"
|
||||
fi
|
||||
# Restart nginx with updated config (copied via SCP step)
|
||||
echo "=== Restarting nginx ==="
|
||||
docker compose -f docker-compose.prod.yml up -d --no-deps --force-recreate nginx
|
||||
echo "Nginx restarted"
|
||||
|
||||
# Cleanup old images
|
||||
docker image prune -f
|
||||
|
||||
Reference in New Issue
Block a user