fix: update workflows for Go 1.25.1 and SSH deployment
Test workflow: - Upgrade golangci-lint-action from v6 to v7 - v7 is required for golangci-lint v2.x support - Remove skip-cache as v7 handles caching better Deploy workflow: - Fix SSH heredoc to use unquoted ENDSSH delimiter - Allows environment variables to expand in remote session - Fixes "Permission denied" by properly passing REPO_PATH and SERVICE_NAME
This commit is contained in:
@@ -31,26 +31,26 @@ jobs:
|
||||
|
||||
# Pull latest code and restart service
|
||||
echo "🔄 Pulling latest code and restarting service..."
|
||||
ssh -i ~/.ssh/deploy_key -p $SSH_PORT $SSH_USER@$SSH_HOST << 'ENDSSH'
|
||||
ssh -i ~/.ssh/deploy_key -p $SSH_PORT $SSH_USER@$SSH_HOST << ENDSSH
|
||||
set -e
|
||||
|
||||
echo "📥 Pulling latest changes..."
|
||||
cd ${{ env.REPO_PATH }}
|
||||
cd $REPO_PATH
|
||||
git pull origin main
|
||||
|
||||
echo "🔄 Restarting service..."
|
||||
sudo systemctl restart ${{ env.SERVICE_NAME }}
|
||||
sudo systemctl restart $SERVICE_NAME
|
||||
|
||||
echo "⏳ Waiting for service to start..."
|
||||
sleep 3
|
||||
|
||||
# Check service status
|
||||
if sudo systemctl is-active --quiet ${{ env.SERVICE_NAME }}; then
|
||||
if sudo systemctl is-active --quiet $SERVICE_NAME; then
|
||||
echo "✅ Service restarted successfully"
|
||||
sudo systemctl status ${{ env.SERVICE_NAME }} --no-pager -l
|
||||
sudo systemctl status $SERVICE_NAME --no-pager -l
|
||||
else
|
||||
echo "❌ Service failed to start"
|
||||
sudo journalctl -u ${{ env.SERVICE_NAME }} -n 50 --no-pager
|
||||
sudo journalctl -u $SERVICE_NAME -n 50 --no-pager
|
||||
exit 1
|
||||
fi
|
||||
ENDSSH
|
||||
|
||||
@@ -28,10 +28,9 @@ jobs:
|
||||
run: go mod download
|
||||
|
||||
- name: Run linter
|
||||
uses: golangci/golangci-lint-action@v6
|
||||
uses: golangci/golangci-lint-action@v7
|
||||
with:
|
||||
version: v2.6.0
|
||||
skip-cache: true
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user