AEG-X-004: deploy DbUp migrations with release artifact #11

Merged
kjh2064 merged 5 commits from fix/deploy-db-migrator-migrations into main 2026-08-06 15:21:23 +09:00
Showing only changes of commit 30f4858a34 - Show all commits
+14 -10
View File
@@ -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