Skip to content

Commit 7f187d2

Browse files
committed
reverting the deploy from backup on EC2 if the smoke tests fails
1 parent d9f54be commit 7f187d2

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/deploy-Dataspace-dev.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,23 @@ jobs:
9797
TEST_EMAIL_2: ${{ secrets.TEST_EMAIL_2 }}
9898
TEST_PASSWORD_2: ${{ secrets.TEST_PASSWORD_2 }}
9999
QA_REPO_PAT: ${{ secrets.QA_REPO_PAT }}
100+
101+
revert_deploy:
102+
name: Revert Deployment on Smoke Test Failure
103+
needs: smoke_tests
104+
if: failure()
105+
runs-on: ubuntu-latest
106+
107+
steps:
108+
- name: Revert to Backup Build on EC2
109+
uses: appleboy/[email protected]
110+
with:
111+
host: ${{ secrets.EC2_HOST_DEV_DS }}
112+
username: ${{ secrets.EC2_USERNAME_DS }}
113+
key: ${{ secrets.EC2_PRIVATE_KEY }}
114+
script: |
115+
rm -rf DataExchange/DataExFrontend/.next
116+
rm -rf DataExchange/DataExFrontend/public
117+
mv DataExchange/DataExFrontend/.next_backup DataExchange/DataExFrontend/.next
118+
mv DataExchange/DataExFrontend/public_backup DataExchange/DataExFrontend/public
119+
/home/ubuntu/.nvm/versions/node/v20.11.1/bin/pm2 restart dataspace

0 commit comments

Comments
 (0)