ci: local deploy — no SSH, runner is on same Lightsail instance

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-20 07:33:31 +01:00
parent 7f078f5734
commit 221b7bc587
+18 -28
View File
@@ -36,36 +36,26 @@ jobs:
- name: Deploy to git.arikigame.com
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
RESTART: ${{ github.event.inputs.restart }}
run: |
mkdir -p ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
set -e
echo "Backing up current binary..."
sudo cp /usr/local/bin/gitea /usr/local/bin/gitea.backup.$(date +%Y%m%d-%H%M%S) || true
echo "Deploying tinqs-git to $DEPLOY_HOST..."
echo "Stopping gitea..."
sudo systemctl stop gitea || true
scp -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no \
gitea ubuntu@$DEPLOY_HOST:/tmp/tinqs-git
echo "Installing tinqs-git..."
sudo cp gitea /usr/local/bin/gitea
sudo chmod +x /usr/local/bin/gitea
sudo chown gitea:gitea /usr/local/bin/gitea || true
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no \
ubuntu@$DEPLOY_HOST "
echo 'Backing up current binary...'
sudo cp /usr/local/bin/gitea /usr/local/bin/gitea.backup.\$(date +%Y%m%d-%H%M%S) || true
echo 'Stopping gitea...'
sudo systemctl stop gitea || true
echo 'Installing tinqs-git...'
sudo cp /tmp/tinqs-git /usr/local/bin/gitea
sudo chmod +x /usr/local/bin/gitea
sudo chown gitea:gitea /usr/local/bin/gitea || true
if [ '$RESTART' = 'true' ]; then
echo 'Starting gitea...'
sudo systemctl start gitea
sleep 2
sudo systemctl status gitea --no-pager
else
echo 'Restart skipped (RESTART=false). Start manually: sudo systemctl start gitea'
fi
echo 'Deploy complete.'
"
if [ "$RESTART" = "true" ]; then
echo "Starting gitea..."
sudo systemctl start gitea
sleep 2
sudo systemctl status gitea --no-pager
else
echo "Restart skipped. Start manually: sudo systemctl start gitea"
fi
echo "Deploy complete."