OUTPOST-181 ofsted client #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to create, configure and deploy artefacts and resources | |
# for the PPE Inventory project in the DEMO environment | |
name: Static IP address proxy function | |
on: | |
push: | |
branches: | |
[OUTPOST-181-update-ofsted-feed-application-to-work-with-new-certificate] | |
paths: | |
- "proxy-function/**" | |
- ".github/workflows/proxy-function.yml" | |
jobs: | |
proxy-function: | |
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 form function | |
- name: Deploy proxy function | |
# ofsted_stub=$(gcloud run services describe ofsted-stub --platform=managed --region=europe-west1 --format="value(status.url)") | |
# ENDPOINT_SERVICE=${ofsted_stub}, | |
run: | | |
cd proxy-function | |
project_id=$(gcloud config get-value project) | |
project_number=$(gcloud projects describe $project_id --format="value(projectNumber)") | |
gcloud functions deploy ofsted_feed_proxy \ | |
--runtime=python312 --region=europe-west2 --memory=256MB --trigger-http \ | |
--no-allow-unauthenticated \ | |
--vpc-connector ofsted-egress-vpcc \ | |
--egress-settings all \ | |
--timeout=540 \ | |
--no-gen2 \ | |
--service-account=${project_number}[email protected] \ | |
--set-env-vars PROJECT_ID=${project_id} | |
- name: Permission to call the function | |
run: | | |
project_id=$(gcloud config get-value project) | |
project_number=$(gcloud projects describe $project_id --format="value(projectNumber)") | |
gcloud functions add-iam-policy-binding ofsted_feed_proxy --region europe-west2 \ | |
--member=serviceAccount:${project_number}[email protected] \ | |
--role=roles/cloudfunctions.invoker |