@@ -28,25 +28,48 @@ jobs:
28
28
username : _json_key
29
29
password : ${{ secrets.DOCKER_REGISTRY_SA }}
30
30
31
- push :
31
+ push-gateway :
32
32
needs : login
33
33
runs-on : ubuntu-latest
34
34
steps :
35
35
- name : Build and push
36
36
uses : docker/build-push-action@v6
37
37
with :
38
- context : " {{defaultContext}}:backend"
38
+ context : " {{defaultContext}}:backend/gateway "
39
39
push : true
40
- tags : ${{ secrets.SERVICE_NAME }}:latest
40
+ tags : ${{ secrets.GATEWAY_SERVICE_NAME }}:latest
41
41
42
- deploy :
43
- needs : push
42
+ push-storage :
43
+ needs : login
44
+ runs-on : ubuntu-latest
45
+ steps :
46
+ - name : Build and push
47
+ uses : docker/build-push-action@v6
48
+ with :
49
+ context : " {{defaultContext}}:backend/storage"
50
+ push : true
51
+ tags : ${{ secrets.STORAGE_SERVICE_NAME }}:latest
52
+
53
+ deploy-gateway :
54
+ needs : push-gateway
55
+ runs-on : ubuntu-latest
56
+
57
+ steps :
58
+ - uses : actions/checkout@v4
59
+ - name : Deploy artifact
60
+ run : |
61
+ gcloud auth activate-service-account ${{ secrets.CLOUD_RUN_SA }} --key-file=${{ secrets.CLOUD_RUN_SA_KEY }}
62
+ gcloud run deploy ${{ secrets.GATEWAY_SERVICE_NAME }} --service-account=${{ secrets.CLOUD_RUN_SA }} --allow-unauthenticated --region=${{ secrets.REGION }} --project=${{ secrets.REGION }} --port=80 --image=${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.GATEWAY_SERVICE_NAME }}/${{ secrets.GATEWAY_SERVICE_NAME }}:latest
63
+ gcloud beta run services add-iam-policy-binding --region=${{ secrets.REGION }} --member=allUsers --role=roles/run.invoker ${{ secrets.GATEWAY_SERVICE_NAME }} --project=${{ secrets.PROJECT_ID}}
64
+
65
+ deploy-storage :
66
+ needs : push-storage
44
67
runs-on : ubuntu-latest
45
68
46
69
steps :
47
70
- uses : actions/checkout@v4
48
71
- name : Deploy artifact
49
72
run : |
50
73
gcloud auth activate-service-account ${{ secrets.CLOUD_RUN_SA }} --key-file=${{ secrets.CLOUD_RUN_SA_KEY }}
51
- gcloud run deploy ${{ secrets.SERVICE_NAME }} --service-account=${{ secrets.CLOUD_RUN_SA }} --allow-unauthenticated --region=${{ secrets.REGION }} --project=${{ secrets.REGION }} --port=80 --image=${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.SERVICE_NAME }}/${{ secrets.SERVICE_NAME }}:latest
52
- gcloud beta run services add-iam-policy-binding --region=${{ secrets.REGION }} --member=allUsers --role=roles/run.invoker ${{ secrets.SERVICE_NAME }} --project=${{ secrets.PROJECT_ID}}
74
+ gcloud run deploy ${{ secrets.STORAGE_SERVICE_NAME }} --service-account=${{ secrets.CLOUD_RUN_SA }} --allow-unauthenticated --region=${{ secrets.REGION }} --project=${{ secrets.REGION }} --port=80 --image=${{ secrets.REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.STORAGE_SERVICE_NAME }}/${{ secrets.STORAGE_SERVICE_NAME }}:latest
75
+ gcloud beta run services add-iam-policy-binding --region=${{ secrets.REGION }} --member=allUsers --role=roles/run.invoker ${{ secrets.STORAGE_SERVICE_NAME }} --project=${{ secrets.PROJECT_ID}}
0 commit comments