Files
QuantEngineByItz/.gitea/workflows/snapshot_admin_deploy.yml
kjh2064 99c4885692
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (push) Failing after 4s
WBS-9.3 - NULL Policy CI Gate / NULL Policy Validation (pull_request) Failing after 6s
Quant Engine CI/CD Pipeline / validate-core (pull_request) Failing after 2m16s
Quant Engine CI/CD Pipeline / validate-ui-and-storage (pull_request) Has been skipped
deploy workflow and docs
2026-06-26 18:07:13 +09:00

74 lines
2.6 KiB
YAML

name: Snapshot Admin Deployment
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: snapshot-admin-deploy-main
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.0.x'
- name: Publish Blazor Web App
run: |
echo "[deploy] publishing .NET 10 Blazor app"
dotnet publish src/dotnet/QuantEngine.Web/QuantEngine.Web.csproj -c Release -o ./publish
- name: Compress Artifact
run: |
echo "[deploy] compressing publish output"
tar -czf quantengine.tar.gz -C ./publish .
- name: Deploy to Host via Local SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
echo "[deploy] setting up SSH and deploying shadow copy"
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" | base64 -d > ~/.ssh/id_ed25519
wc -c ~/.ssh/id_ed25519
md5sum ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 178.104.200.7 >> ~/.ssh/known_hosts
# Upload artifact and deploy script to host
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "mkdir -p /home/kjh2064/tmp"
scp -i ~/.ssh/id_ed25519 quantengine.tar.gz kjh2064@178.104.200.7:/home/kjh2064/tmp/quantengine.tar.gz
# Execute hot deploy script
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh 2>/dev/null || true"
scp -i ~/.ssh/id_ed25519 tools/deploy_quantengine.sh kjh2064@178.104.200.7:/home/kjh2064/tmp/deploy.sh
ssh -i ~/.ssh/id_ed25519 kjh2064@178.104.200.7 "chmod +x /home/kjh2064/tmp/deploy.sh && /home/kjh2064/tmp/deploy.sh"
- name: Verify Public Routes
run: |
set -e
root_html=$(curl -s "http://178.104.200.7/quant/")
ops_html=$(curl -s "http://178.104.200.7/quant/operations")
root_code=$(printf '%s' "$root_html" | grep -q "Quant Engine" && echo 200 || echo 500)
ops_code=$(printf '%s' "$ops_html" | grep -q "Operational Report" && echo 200 || echo 500)
echo "/quant/ -> ${root_code}"
echo "/quant/operations -> ${ops_code}"
if [ "$root_code" != "200" ]; then
echo "Deployment content check failed for /quant/"
exit 1
fi
if [ "$ops_code" != "200" ]; then
echo "Deployment content check failed for /quant/operations"
exit 1
fi