@@ -19,24 +19,36 @@ jobs:
1919 distribution : ' corretto'
2020 java-version : 17
2121
22- - name : Authenticate
23- uses : google-github-actions/auth@v2
24- with :
25- credentials_json : ${{ secrets.GCP_SA_KEY }}
26-
27- - name : Configure gcloud
28- uses : google-github-actions/setup-gcloud@v2
22+ - name : Install OpenVPN
23+ run : sudo apt-get update && sudo apt-get install -y openvpn
24+
25+ - name : Connect to VPN
26+ env :
27+ VPN_USERNAME : ${{ secrets.VPN_USERNAME }}
28+ VPN_PASSWORD : ${{ secrets.VPN_PASSWORD }}
29+ run : |
30+ echo "${{ secrets.VPN_PROFILE_BASE64 }}" | base64 --decode > profile-559.ovpn
31+ echo -e "${VPN_USERNAME}\n${VPN_PASSWORD}" > vpn-auth.txt
32+ sudo openvpn --config profile-559.ovpn --auth-user-pass vpn-auth.txt --daemon
33+ sleep 10
34+ rm vpn-auth.txt
35+ rm profile-559.ovpn
36+
37+ - name : Deploy to Server
38+ uses : appleboy/ssh-action@v0.1.10
2939 with :
30- project_id : ${{ env.PROJECT_ID }}
31- install_components : ' gke-gcloud-auth-plugin'
40+ host : ${{ secrets.SERVER_HOST }}
41+ username : ${{ secrets.SERVER_USERNAME }}
42+ key : ${{ secrets.SERVER_SSH_KEY }}
43+ script : |
44+ cd /home/ubuntu/K8S
45+ sudo kubectl apply -f comment-mongo-deployment.yaml
46+ sudo kubectl apply -f comment-service-deployment.yaml
3247
33- - name : Set cluster context
34- run : |
35- gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.ZONE }} --project ${{ env.PROJECT_ID }}
3648
37- - name : Apply Kubernetes manifests for application
38- run : |
39- kubectl apply -f resources.yaml
49+ # - name: Apply Kubernetes manifests
50+ # run: |
51+ # kubectl apply -f resources.yaml
4052
4153 notify :
4254 needs : deploy
0 commit comments