ci: self-hosted runner 직접 실행 (SSH 불필요) + root 모드 sudo 자동 스킵
Deploy / deploy (push) Failing after 0s

This commit is contained in:
chpark
2026-04-23 01:20:50 +09:00
parent d05685935d
commit 49639252bf
2 changed files with 43 additions and 28 deletions
+27 -22
View File
@@ -1,4 +1,4 @@
name: Deploy via SSH
name: Deploy
on:
push:
@@ -6,25 +6,30 @@ on:
workflow_dispatch:
jobs:
remote-deploy:
runs-on: ubuntu-latest
deploy:
runs-on: self-hosted
steps:
- name: Trigger remote deploy on server
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SSH_HOST }}
port: ${{ secrets.SSH_PORT || 22 }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
command_timeout: 20m
script: |
set -e
cd /home/chpark
if [ ! -d insurance/.git ]; then
git clone https://git.junggomoa.com/chpark/insurance.git
fi
cd insurance
git fetch origin
git reset --hard origin/master
chmod +x scripts/deploy-remote.sh
bash scripts/deploy-remote.sh
- name: Sync repo
run: |
cd /home/chpark
if [ ! -d insurance/.git ]; then
git clone https://git.junggomoa.com/chpark/insurance.git
fi
cd insurance
git fetch origin
git reset --hard "origin/${GITHUB_REF##*/}"
- name: Deploy to k3s
run: |
cd /home/chpark/insurance
chmod +x scripts/deploy-remote.sh
bash scripts/deploy-remote.sh
- name: Show status
if: always()
run: |
export KUBECONFIG=/home/chpark/.kube/config
kubectl -n insurance get pods,svc 2>&1 || true
echo ""
echo "🚀 Web: https://insurance.junggomoa.com"
echo "🔌 API: https://api.insurance.junggomoa.com"