77 workflow_dispatch :
88
99jobs :
10- setup- build-publish-deploy :
11- name : Setup, Build, Publish, and Deploy
10+ build-proxy :
11+ name : Build Proxy
1212 runs-on : ubuntu-latest
1313
1414 steps :
@@ -27,15 +27,81 @@ jobs:
2727 run : |
2828 gcloud --quiet auth configure-docker
2929
30- - name : Build and Push Docker Image
30+ - name : Build Docker Image
3131 run : |
3232 docker build -t gcr.io/baileybutler-syd/sreekipedia:${{ github.sha }} .
3333 docker push gcr.io/baileybutler-syd/sreekipedia:${{ github.sha }}
3434
35+ deploy-proxy :
36+ name : Deploy Proxy
37+ runs-on : ubuntu-latest
38+ needs :
39+ - build-proxy
40+ - build-sreeifier
41+
42+ steps :
43+ - name : Authorise GCP
44+ uses : google-github-actions/auth@v1
45+ with :
46+ credentials_json : ${{ secrets.SA_JSON }}
47+
48+ - name : Set up Cloud SDK
49+ uses : google-github-actions/setup-gcloud@v0.3
50+
3551 - name : Deploy to Cloud Run
3652 uses : google-github-actions/deploy-cloudrun@v1
3753 with :
3854 service : sreekipedia
3955 image : gcr.io/baileybutler-syd/sreekipedia:${{ github.sha }}
4056 region : asia-southeast1
41- flags : " --min-instances=1 --max-instances=100 --allow-unauthenticated"
57+ flags : " --min-instances=0 --max-instances=100 --allow-unauthenticated"
58+ env_vars : |
59+ SREEIFIER_SERVER=sreeifier-vvgwyvu7bq-as.a.run.app:443
60+
61+ build-sreeifier :
62+ name : Build Sreeifier
63+ runs-on : ubuntu-latest
64+
65+ steps :
66+ - name : Checkout
67+ uses : actions/checkout@v2
68+
69+ - name : Authorise GCP
70+ uses : google-github-actions/auth@v1
71+ with :
72+ credentials_json : ${{ secrets.SA_JSON }}
73+
74+ - name : Set up Cloud SDK
75+ uses : google-github-actions/setup-gcloud@v0.3
76+
77+ - name : Configure Docker
78+ run : |
79+ gcloud --quiet auth configure-docker
80+
81+ - name : Build Docker Image
82+ run : |
83+ docker build -t gcr.io/baileybutler-syd/sreeifier:${{ github.sha }} ./python
84+ docker push gcr.io/baileybutler-syd/sreeifier:${{ github.sha }}
85+
86+ deploy-sreeifier :
87+ name : Deploy Sreeifier
88+ runs-on : ubuntu-latest
89+ needs :
90+ - build-sreeifier
91+
92+ steps :
93+ - name : Authorise GCP
94+ uses : google-github-actions/auth@v1
95+ with :
96+ credentials_json : ${{ secrets.SA_JSON }}
97+
98+ - name : Set up Cloud SDK
99+ uses : google-github-actions/setup-gcloud@v0.3
100+
101+ - name : Deploy to Cloud Run
102+ uses : google-github-actions/deploy-cloudrun@v1
103+ with :
104+ service : sreeifier
105+ image : gcr.io/baileybutler-syd/sreeifier:${{ github.sha }}
106+ region : asia-southeast1
107+ flags : " --min-instances=0 --max-instances=100 --use-http2 --allow-unauthenticated"
0 commit comments