From 3c4712b5eeba38feed03c9ddb54b9fb2fc2794d8 Mon Sep 17 00:00:00 2001 From: eewing Date: Tue, 17 Feb 2026 10:11:25 -0600 Subject: [PATCH] Update CI workflow to enhance deployment command for application restart - Modified the deployment command in the CI workflow to use 'bash -lc' for improved execution context. - Updated the pm2 restart logic to include the '--update-env' flag for better environment variable handling during application restarts. --- .gitea/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index d0a27c8..e93fef1 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -90,4 +90,4 @@ jobs: run: | sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=accept-new -p ${{ secrets.DEPLOY_SSH_PORT || '22' }} \ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST || env.DEPLOY_HOST }} \ - "cd ${{ secrets.DEPLOY_PATH || env.DEPLOY_PATH }} && export PORT=${{ env.APP_PORT }} && (command -v pm2 &>/dev/null && (pm2 restart hrm 2>/dev/null || pm2 start build/index.js --name hrm) || true) || (sudo systemctl restart hrm 2>/dev/null) || (nohup node build > /var/log/hrm.log 2>&1 &)" \ No newline at end of file + 'bash -lc "cd ${{ secrets.DEPLOY_PATH || env.DEPLOY_PATH }} && export PORT=${{ env.APP_PORT }} && (pm2 restart hrm 2>/dev/null || pm2 start build/index.js --name hrm --update-env)"' \ No newline at end of file