-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (34 loc) · 1.53 KB
/
ofsted-client.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# This is a basic workflow to create, configure and deploy artefacts and resources
# for the PPE Inventory project in the DEMO environment
name: Ofsted client container
# on:
# push:
# branches: [main]
# paths:
# - "ofsted-client/**"
jobs:
ofsted-client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
project_id: ${{ secrets.PROJECT_ID }}
# Deploy the container
# see: https://cloud.google.com/run/docs/locations
# NB Cloud Run is currently available in eurompe-west1 (Belgium) and europe-west2 (Netherlands) but not europe-west2 (London)
- name: Build feed-client image
run: |
cd ofsted-client
project_id=$(gcloud config get-value project)
gcloud builds submit --tag gcr.io/${project_id}/ofsted-feed-client --timeout 15m
- name: Deploy feed-client container
run: |
project_id=$(gcloud config get-value project)
project_number=$(gcloud projects describe $project_id --format="value(projectNumber)")
function_url=https://europe-west2-${project_id}.cloudfunctions.net/ofsted_feed_proxy
gcloud run deploy ofsted-feed-client --image=gcr.io/${project_id}/ofsted-feed-client \
--platform=managed --region=europe-west1 --allow-unauthenticated \
--update-env-vars=FUNCTION_URL=${function_url},PROJECT_ID=${project_id}