All checks were successful
Deploy to Production / deploy (push) Successful in 1m7s
- Add InspectionTemplate and InspectionTemplateItem models - Add 9 API endpoints for template CRUD and item management - Add Alembic migration for inspection_templates tables - Add 15 backend tests (39/39 total pass) - Add TemplateEditor component with item management UI - Add templates list, create, and edit pages - Add tab bar, template grid, form row CSS classes - Fix CORS middleware ordering in main.py - Move CORS middleware before router registration Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
57 lines
2.1 KiB
YAML
57 lines
2.1 KiB
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
steps:
|
|
- name: Install tools
|
|
run: |
|
|
rm -f /etc/apt/sources.list.d/github_git-lfs.list || true
|
|
apt-get update && apt-get install -y openssh-client rsync git
|
|
|
|
- name: Checkout code
|
|
run: |
|
|
git clone https://geonhee:${{ secrets.DEPLOY_TOKEN }}@g.wace.me/geonhee/factoryOps-v2.git /tmp/factoryOps-v2
|
|
cd /tmp/factoryOps-v2 && git checkout main
|
|
|
|
- name: Deploy to server
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/deploy_key
|
|
chmod 600 ~/.ssh/deploy_key
|
|
|
|
rsync -avz --delete \
|
|
--exclude '.git' \
|
|
--exclude 'node_modules' \
|
|
--exclude '__pycache__' \
|
|
--exclude '.venv' \
|
|
--exclude '.env' \
|
|
--exclude '.next' \
|
|
--exclude 'planning' \
|
|
-e "ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key" \
|
|
/tmp/factoryOps-v2/ geonhee@192.168.1.200:~/factoryops-v2/
|
|
|
|
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key geonhee@192.168.1.200 << 'ENDSSH'
|
|
cd ~/factoryops && ~/.local/bin/docker-compose -f docker-compose.prod.yml down 2>/dev/null || true
|
|
cd ~/factoryops-v2
|
|
~/.local/bin/docker-compose -f docker-compose.prod.yml down 2>/dev/null || true
|
|
~/.local/bin/docker-compose -f docker-compose.prod.yml up -d --build --force-recreate
|
|
echo "=== Waiting 15s for containers to stabilize ==="
|
|
sleep 15
|
|
echo "=== Container Status ==="
|
|
~/.local/bin/docker-compose -f docker-compose.prod.yml ps
|
|
echo "=== API Container Logs ==="
|
|
docker logs factoryops-v2-api --tail 50 2>&1
|
|
echo "=== Dashboard Container Logs ==="
|
|
docker logs factoryops-v2-dashboard --tail 20 2>&1
|
|
echo "FactoryOps v2 deployed at $(date)"
|
|
ENDSSH
|
|
rm -f ~/.ssh/deploy_key
|