Files
factoryOps-v2/.gitea/workflows/deploy.yml
Johngreen fcff23cd7c
Some checks failed
Deploy to Production / deploy (push) Failing after 1m24s
chore: add CI/CD pipeline and container configs for production deployment
- Containerfile.backend/frontend for Docker builds
- docker-compose.prod.yml (PostgreSQL + API:8100 + Dashboard:4000)
- Gitea Actions workflow for auto-deploy on push to main
- Frontend dev port changed to 3100

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 12:21:07 +09:00

47 lines
1.5 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-v2
~/.local/bin/docker-compose -f docker-compose.prod.yml up -d --build --force-recreate
echo "FactoryOps v2 deployed at $(date)"
ENDSSH
rm -f ~/.ssh/deploy_key