File tree 1 file changed +13
-10
lines changed
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -49,33 +49,35 @@ jobs:
49
49
exit 1
50
50
fi
51
51
52
- # Configuration of SSH
52
+ # Configure SSH for access
53
53
mkdir -p ~/.ssh
54
54
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | tee ~/.ssh/id_rsa > /dev/null
55
55
chmod 600 ~/.ssh/id_rsa
56
56
ssh-keyscan -H "$SERVER_IP" >> ~/.ssh/known_hosts
57
57
58
- # Test SSH
58
+ # Test SSH connection
59
59
ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_IP" "echo 'SSH connection successful'"
60
-
60
+
61
+ # Deploy to the test server
61
62
rsync -avz --chown=$SERVER_USER:www-data --chmod=775 --delete dist/ "$SERVER_USER@$SERVER_IP:$SERVER_PATH"
63
+
62
64
test :
63
65
runs-on : ubuntu-latest
64
- needs : build
66
+ needs : deploy-on-test
65
67
steps :
66
68
- name : Checkout Selenium Tests Repository
67
69
run : |
68
70
git clone https://github.com/coundia/selenium-java-pcoundia.git selenium-tests
69
71
70
72
- name : Run Selenium Tests
71
73
env :
72
- SERVER_URL : " https://pcoundia.com"
74
+ SERVER_URL : " https://test. pcoundia.com" # Point to your test server URL
73
75
run : |
74
76
cd selenium-tests
75
77
mvn clean test -Dapp.url=$SERVER_URL
76
78
77
79
deploy-on-prod :
78
- needs : build
80
+ needs : test
79
81
runs-on : ubuntu-latest
80
82
steps :
81
83
- name : Download build artifacts
@@ -97,13 +99,14 @@ jobs:
97
99
exit 1
98
100
fi
99
101
100
- # Configuration of SSH
102
+ # Configure SSH for access
101
103
mkdir -p ~/.ssh
102
104
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | tee ~/.ssh/id_rsa > /dev/null
103
105
chmod 600 ~/.ssh/id_rsa
104
106
ssh-keyscan -H "$SERVER_IP" >> ~/.ssh/known_hosts
105
107
106
- # Test SSH
108
+ # Test SSH connection
107
109
ssh -o StrictHostKeyChecking=no "$SERVER_USER@$SERVER_IP" "echo 'SSH connection successful'"
108
-
109
- rsync -avz --chown=$SERVER_USER:www-data --chmod=775 --delete dist/ "$SERVER_USER@$SERVER_IP:$SERVER_PATH"
110
+
111
+ # Deploy to the production server
112
+ rsync -avz --chown=$SERVER_USER:www-data --chmod=775 --delete dist/ "$SERVER_USER@$SERVER_IP:$SERVER_PATH"
You can’t perform that action at this time.
0 commit comments