From 30f4858a3477e2a5f97b7de17a84956fa4108500 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 6 Aug 2026 14:46:01 +0900 Subject: [PATCH] AEG-X-004: deploy DbUp migrations with release artifact --- .gitea/workflows/deploy.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index b2c47a45..9bd60f83 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -30,6 +30,9 @@ jobs: run: | dotnet publish -c Release -o ./publish src/KArtSell.Host dotnet publish -c Release -o ./publish src/KArtSell.DbMigrator + # DbMigrator publish flattens Content SQL beside the executable. + # Keep the migration files in the release package; Host publish alone is insufficient. + test -f ./publish/0032_shadow_run_queued_status_contract.sql - name: Create deployment package run: | @@ -53,16 +56,17 @@ jobs: echo "✅ File transferred" echo "" - echo "📋 Next steps on server (run these):" - echo " ssh kjh2064@178.104.200.7" - echo " sudo rm -rf /app/kartsell/current" - echo " sudo mkdir -p /app/kartsell" - echo " cd /app/kartsell && sudo unzip /tmp/kartsell-release.zip" - echo " export KARTSELL_POSTGRES='${{ secrets.KARTSELL_POSTGRES }}'" - echo " dotnet KArtSell.DbMigrator.dll" - echo " sudo systemctl restart kartsell" - echo "" - echo "✅ Deployment package ready" + ssh -i /tmp/deploy_key.pem -o StrictHostKeyChecking=no kjh2064@178.104.200.7 \ + "export KARTSELL_POSTGRES='${{ secrets.KARTSELL_POSTGRES }}'; \ + sudo mkdir -p /app/kartsell/current; \ + sudo unzip -oq /tmp/kartsell-release.zip -d /app/kartsell/current; \ + cd /app/kartsell/current; \ + dotnet KArtSell.DbMigrator.dll; \ + sudo systemctl restart kartsell; \ + sleep 3; \ + systemctl is-active --quiet kartsell" + + echo "✅ Artifact deployed, DbMigrator executed, and kartsell restarted" # Cleanup rm /tmp/deploy_key.pem