Skip to content

Commit 586c854

Browse files
committed
update
1 parent e2b37ca commit 586c854

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

.github/workflows/deploy-languages-v2-web.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
env:
1414
PROJECT_PATH: apps/languagesv2/languages-v2-web
15+
TARGET_PATH: /root/apps
1516
steps:
1617
- uses: actions/checkout@v4
1718
- name: Set up Node.js
@@ -24,6 +25,10 @@ jobs:
2425
- name: Build React App
2526
working-directory: ${{ env.PROJECT_PATH }}
2627
run: npm run build
28+
- name: Clean target folder on remote server
29+
run: |
30+
sshpass -p "${{ secrets.UTS_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.UTS_USERNAME }}@${{ secrets.UTS_HOST }} -p ${{ secrets.UTS_PORT }} "
31+
rm -rf ${{ env.TARGET_PATH }}/*"
2732
- name: Copy file via ssh password
2833
uses: appleboy/[email protected]
2934
with:
@@ -32,5 +37,9 @@ jobs:
3237
password: ${{ secrets.UTS_PASSWORD }}
3338
port: ${{ secrets.UTS_PORT }}
3439
source: "${{ env.PROJECT_PATH }}/build/*"
35-
target: "/root/apps2"
36-
recursive: true
40+
target: "${{ env.TARGET_PATH }}"
41+
recursive: true
42+
- name: Move build files to target folder on remote server
43+
run: |
44+
sshpass -p "${{ secrets.UTS_PASSWORD }}" ssh -o StrictHostKeyChecking=no ${{ secrets.UTS_USERNAME }}@${{ secrets.UTS_HOST }} -p ${{ secrets.UTS_PORT }}
45+
"mv ${{ env.TARGET_PATH }}/${{ env.PROJECT_PATH }}/build/* ${{ env.TARGET_PATH }}/ && rm -rf ${{ env.TARGET_PATH }}/apps"

0 commit comments

Comments
 (0)