File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,17 +48,39 @@ jobs:
4848 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4949
5050 # Send to the server
51- - name : multiple command
51+ - name : Update the Server Side
5252 uses : appleboy/ssh-action@v1.1.0
53+ env :
54+ RELEASE_TAG : ${{ github.event.release.tag_name }}
5355 with :
5456 host : ${{ secrets.SSH_HOST }}
5557 username : ${{ secrets.SSH_USERNAME }}
5658 key : ${{ secrets.SSH_PRIVATE_KEY }}
5759 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..."
6184 mv build.zip web/
6285 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