Skip to content

Commit 02ca623

Browse files
authored
chore: EU Production (#81)
* GitHub actions for EU Prod deployment
1 parent b1dd4fb commit 02ca623

File tree

3 files changed

+128
-3
lines changed

3 files changed

+128
-3
lines changed

.github/workflows/client.yaml

+54-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ jobs:
8686

8787
- name: Capture Environment Variables
8888
run: |
89-
echo VITE_AUTH_LOGIN_URL=${{ secrets.STAGING_AUTH_URL }} > .env
90-
echo VITE_AUTH_PROJECT_ID=${{ secrets.STAGING_AUTH_PROJECT_ID }} >> .env
9189
echo VITE_GRAPHQL_ENDPOINT=${{ secrets.STAGING_GRAPHQL_ENDPOINT }} >> .env
9290
echo VITE_ASL_LEXICON_ID=${{ secrets.STAGING_ASL_LEXICON_ID }} >> .env
9391
echo VITE_NAME=${{ secrets.STAGING_ASL_LEX_NAME }} >> .env
@@ -108,10 +106,63 @@ jobs:
108106
workload_identity_provider: ${{ secrets.GCP_STAGING_ID_PROVIDER }}
109107
service_account: ${{ secrets.STAGING_GCP_SERVICE_ACCOUNT }}
110108

111-
112109
- name: Upload Files
113110
uses: 'google-github-actions/upload-cloud-storage@v2'
114111
with:
115112
path: packages/client/dist/
116113
destination: ${{ secrets.GCP_FRONTEND_BUCKET }}
117114
parent: false
115+
116+
eu-prod-deploy:
117+
runs-on: ubuntu-latest
118+
name: Deploy to EU Prod
119+
needs: [lint, build]
120+
permissions:
121+
contents: 'read'
122+
id-token: 'write'
123+
if: startsWith(github.ref, 'refs/tags/v')
124+
defaults:
125+
run:
126+
working-directory: packages/client
127+
128+
steps:
129+
- name: Checkout Repository
130+
uses: actions/checkout@v3
131+
132+
# App Engine deploy logic does not play well with
133+
- name: Cleanup
134+
run: rm package-lock.json
135+
136+
- name: Setup NodeJS
137+
uses: actions/setup-node@v3
138+
with:
139+
node-version: 18
140+
141+
- name: Capture Environment Variables
142+
run: |
143+
echo VITE_GRAPHQL_ENDPOINT=${{ secrets.PROD_EU_GRAPHQL_ENDPOINT }} >> .env
144+
echo VITE_ASL_LEXICON_ID=${{ secrets.PROD_EU_ASL_LEXICON_ID }} >> .env
145+
echo VITE_NAME=${{ secrets.PROD_EU_ASL_LEX_NAME }} >> .env
146+
echo VITE_AUTH_API_KEY=${{ secrets.PROD_EU_AUTH_API_KEY }} >> .env
147+
echo VITE_AUTH_DOMAIN=${{ secrets.PROD_EU_AUTH_DOMAIN }} >> .env
148+
149+
- name: NPM Install
150+
run: npm install
151+
shell: bash
152+
153+
- name: Build
154+
run: npm run build
155+
156+
- name: GCP Auth
157+
uses: 'google-github-actions/auth@v2'
158+
with:
159+
project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }}
160+
workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }}
161+
service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }}
162+
163+
- name: Upload Files
164+
uses: 'google-github-actions/upload-cloud-storage@v2'
165+
with:
166+
path: packages/client/dist/
167+
destination: ${{ secrets.PROD_EU_GCP_FRONTEND_BUCKET }}
168+
parent: false

.github/workflows/gateway.yaml

+35
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,38 @@ jobs:
9696
SIGNLAB_URI=${{ secrets.STAGING_SIGNLAB_URI }}
9797
LEX_URI=${{ secrets.STAGING_LEX_URI }}
9898
AUTH_URI=${{ secrets.STAGING_AUTH_URI }}
99+
100+
eu-prod-deploy:
101+
runs-on: ubuntu-latest
102+
name: Deploy to Staging
103+
needs: [lint, build]
104+
permissions:
105+
contents: 'read'
106+
id-token: 'write'
107+
if: startsWith(github.ref, 'refs/tags/v')
108+
defaults:
109+
run:
110+
working-directory: packages/gateway
111+
steps:
112+
- name: Checkout Repository
113+
uses: actions/checkout@v3
114+
115+
# App Engine deploy logic does not play well with
116+
- name: Cleanup
117+
run: rm package-lock.json
118+
119+
- name: GCP Auth
120+
uses: 'google-github-actions/auth@v2'
121+
with:
122+
project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }}
123+
workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }}
124+
service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }}
125+
126+
- name: Deploy to Staging
127+
uses: 'google-github-actions/deploy-appengine@v2'
128+
with:
129+
working_directory: 'packages/gateway'
130+
env_vars: |-
131+
SIGNLAB_URI=${{ secrets.PROD_EU_SIGNLAB_URI }}
132+
LEX_URI=${{ secrets.PROD_EU_LEX_URI }}
133+
AUTH_URI=${{ secrets.PROD_EU_AUTH_URI }}

.github/workflows/server.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,42 @@ jobs:
9797
CASBIN_MONGO_URI=${{ secrets.STAGING_CASBIN_MONGO_URI }}
9898
ZIP_JOB_NAME=${{ secrets.GCP_ZIP_JOB_STAGING }}
9999
GATEWAY_ENDPOINT=${{ secrets.STAGING_GRAPHQL_ENDPOINT }}
100+
101+
eu-prod-deploy:
102+
runs-on: ubuntu-latest
103+
name: Deploy to Staging
104+
needs: [lint, build]
105+
permissions:
106+
contents: 'read'
107+
id-token: 'write'
108+
if: startsWith(github.ref, 'refs/tags/v')
109+
defaults:
110+
run:
111+
working-directory: packages/server
112+
113+
steps:
114+
- name: Checkout Repository
115+
uses: actions/checkout@v3
116+
117+
# App Engine deploy logic does not play well with
118+
- name: Cleanup
119+
run: rm package-lock.json
120+
121+
- name: GCP Auth
122+
uses: 'google-github-actions/auth@v2'
123+
with:
124+
project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }}
125+
workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }}
126+
service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }}
127+
128+
- name: Deploy to Staging
129+
uses: 'google-github-actions/deploy-appengine@v2'
130+
with:
131+
working_directory: 'packages/server'
132+
env_vars: |-
133+
MONGO_URI=${{ secrets.PROD_EU_MONGO_URI }}
134+
CASBIN_MONGO_URI=${{ secrets.PROD_EU_CASBIN_MONGO_URI }}
135+
ZIP_JOB_NAME=${{ secrets.GCP_ZIP_JOB_PROD_EU }}
136+
GATEWAY_ENDPOINT=${{ secrets.PROD_EU_GRAPHQL_ENDPOINT }}
137+
138+

0 commit comments

Comments
 (0)