happybell80 7dfe04afe7 fix: sudo -n 옵션 추가로 패스워드 프롬프트 방지
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 14:26:52 +09:00

36 lines
1019 B
YAML

name: Deploy to Ubuntu Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Setup SSH key
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.NAS_SSH_KEY_ADMIN }}
- name: Deploy via SSH
env:
HOST: ${{ secrets.NAS_HOST }}
PORT: ${{ secrets.NAS_PORT }}
USER: ${{ secrets.NAS_USER }}
run: |
ssh -o StrictHostKeyChecking=no -p $PORT $USER@$HOST << 'EOF'
sudo -n mkdir -p /opt/robeing-nginx
if [ -d "/opt/robeing-nginx/.git" ]; then
cd /opt/robeing-nginx && git pull origin main
else
git clone https://github.com/ivada-Robeing/nginx-deploy.git /opt/robeing-nginx
cd /opt/robeing-nginx
fi
sudo -n mkdir -p ssl certbot-webroot
sudo -n docker-compose down || true
sudo -n docker-compose up -d
EOF