Skip to content

Commit b5a2832

Browse files
committed
fix error workflow(6)
1 parent b77248c commit b5a2832

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ jobs:
2727
- name: 📂 Prepare build-output folder (exclude node_modules)
2828
run: |
2929
mkdir -p build-output
30-
rsync -av --progress ./ build-output --exclude node_modules --exclude .git
30+
rsync -av --progress ./ build-output/ \
31+
--exclude node_modules \
32+
--exclude .git \
33+
--exclude build-output
3134
echo "📁 Build output content:"
3235
ls -la build-output
3336
@@ -51,13 +54,21 @@ jobs:
5154
key: ${{ secrets.SSH_PRIVATE_KEY }}
5255
passphrase: ${{ secrets.SSH_PASSPHRASE }}
5356
script: |
54-
echo "🔧 Activating Node.js environment..."
55-
${{ secrets.NODE_ENV_PATH }}
56-
echo "📦 Moving files out of build-output..."
57-
mv ${{ secrets.DEPLOY_DIR }}/build-output/* ${{ secrets.DEPLOY_DIR }}/
58-
rm -rf ${{ secrets.DEPLOY_DIR }}/build-output
59-
echo "📦 Installing production dependencies..."
60-
npm ci --omit=dev
61-
echo "♻️ Restarting Node.js app..."
62-
touch tmp/restart.txt || true
63-
echo "✅ Deployment complete!"
57+
echo "🚀 Starting deployment inside Node.js environment..."
58+
bash -lc '
59+
echo "🔧 Activating environment..."
60+
source /home/devstudi/nodevenv/autodeploy/22/bin/activate
61+
cd /home/devstudi/autodeploy
62+
63+
echo "📦 Moving files out of build-output..."
64+
mv build-output/* . || true
65+
rm -rf build-output
66+
67+
echo "📦 Installing production dependencies..."
68+
npm ci --omit=dev
69+
70+
echo "♻️ Restarting Node.js app..."
71+
touch tmp/restart.txt || true
72+
73+
echo "✅ Deployment complete!"
74+
'

0 commit comments

Comments
 (0)