1- # name: Continuous Deployment for User Service
2-
3- # on:
4- # workflow_run:
5- # workflows: ["Continuous Integration for Comment Service"]
6- # types:
7- # - completed
8-
9- # env:
10- # PROJECT_ID: gke-project-423206
11- # CLUSTER_NAME: autopilot-cluster-1
12- # ZONE: us-central1
13-
14- # jobs:
15- # deploy:
16- # name: Deploy to GKE Autopilot
17- # runs-on: ubuntu-latest
18- # steps:
19- # - name: Checkout code
20- # uses: actions/checkout@v3
21-
22- # - name: Setup JDK 17
23- # uses: actions/setup-java@v3
24- # with:
25- # distribution: 'corretto'
26- # java-version: 17
27-
28- # - name: Build the application
29- # run: |
30- # mvn clean
31- # mvn -B package --file pom.xml
32-
33- # - name: Authenticate
34- # uses: google-github-actions/auth@v2
35- # with:
36- # credentials_json: ${{ secrets.GCP_SA_KEY }}
37-
38- # - name: Configure gcloud
39- # uses: google-github-actions/setup-gcloud@v2
40- # with:
41- # project_id: ${{ env.PROJECT_ID }}
42- # install_components: 'gke-gcloud-auth-plugin'
43-
44- # - name: Set cluster context
45- # run: |
46- # gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.ZONE }} --project ${{ env.PROJECT_ID }}
47-
48- # - name: Apply Kubernetes manifests
49- # run: |
50- # kubectl apply -f resources.yaml
51-
52- # notifications:
53- # needs: deploy
54- # uses: ./.github/workflows/notifyCD.yaml
55- # secrets:
56- # SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL}}
1+ name : Continuous Deployment for User Service
2+
3+ on :
4+ workflow_run :
5+ workflows : ["Continuous Integration for Comment Service"]
6+ types :
7+ - completed
8+
9+ env :
10+ PROJECT_ID : gke-project-423206
11+ CLUSTER_NAME : autopilot-cluster-1
12+ ZONE : us-central1
13+
14+ jobs :
15+ deploy :
16+ name : Deploy to GKE Autopilot
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout code
20+ uses : actions/checkout@v3
21+
22+ - name : Setup JDK 17
23+ uses : actions/setup-java@v3
24+ with :
25+ distribution : ' corretto'
26+ java-version : 17
27+
28+ - name : Build the application
29+ run : |
30+ mvn clean
31+ mvn -B package --file pom.xml
32+
33+ - name : Authenticate
34+ uses : google-github-actions/auth@v2
35+ with :
36+ credentials_json : ${{ secrets.GCP_SA_KEY }}
37+
38+ - name : Configure gcloud
39+ uses : google-github-actions/setup-gcloud@v2
40+ with :
41+ project_id : ${{ env.PROJECT_ID }}
42+ install_components : ' gke-gcloud-auth-plugin'
43+
44+ - name : Set cluster context
45+ run : |
46+ gcloud container clusters get-credentials ${{ env.CLUSTER_NAME }} --zone ${{ env.ZONE }} --project ${{ env.PROJECT_ID }}
47+
48+ - name : Apply Kubernetes manifests
49+ run : |
50+ kubectl apply -f resources.yaml
51+
52+ notifications :
53+ needs : deploy
54+ uses : ./.github/workflows/notifyCD.yaml
55+ secrets :
56+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL}}
0 commit comments