Compare commits

...
1 Commits
Author SHA1 Message Date
adminandClaude Opus 4.5 5cb23464e5 Fix nginx deploy: use SCP to copy config files
The production server doesn't have a git repo, so we can't use git
commands to update files. Instead, use appleboy/scp-action to copy
nginx.conf and docker-compose.prod.yml from the runner to the server,
then restart nginx.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 14:02:15 -08:00
+14 -11
View File
@@ -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