File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,39 @@ jobs:
48
48
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
49
50
50
# Send to the server
51
- - name : multiple command
51
+ - name : Update the Server Side
52
52
53
+ env :
54
+ RELEASE_TAG : ${{ github.event.release.tag_name }}
53
55
with :
54
56
host : ${{ secrets.SSH_HOST }}
55
57
username : ${{ secrets.SSH_USERNAME }}
56
58
key : ${{ secrets.SSH_PRIVATE_KEY }}
57
59
script : |
58
- curl -L -o build.zip https://github.com/COMSOC-Community/pabuviz-web/releases/download/${{ github.event.release.tag_name }}/build.zip
59
- rm -rf web_old/*
60
- mv web/* web_old/
60
+ echo "Downloading build.zip from the latest release with tag $RELEASE_TAG..."
61
+ curl -L -o build.zip https://github.com/COMSOC-Community/pabuviz-web/releases/download/$RELEASE_TAG/build.zip
62
+
63
+ # Verify if the download succeeded
64
+ if [ ! -f build.zip ]; then
65
+ echo "Error: build.zip was not downloaded. Check the release URL or network."
66
+ exit 1
67
+ fi
68
+
69
+ # Ensure the web_old and web directories exist
70
+ mkdir -p web_old
71
+ mkdir -p web
72
+
73
+ # Move existing files to backup folder only if files exist
74
+ if [ "$(ls -A web)" ]; then
75
+ echo "Moving existing files to web_old..."
76
+ rm -rf web_old/*
77
+ mv web/* web_old/
78
+ else
79
+ echo "No existing files in web to backup."
80
+ fi
81
+
82
+ # Move and unzip the new build.zip in web directory
83
+ echo "Deploying new build.zip..."
61
84
mv build.zip web/
62
85
cd web/
63
- unzip build.zip
64
- rm build.zip
86
+ unzip build.zip && rm build.zip
You can’t perform that action at this time.
0 commit comments