OUTPOST-181 egress-networking #23
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: [main] | |
# 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 | |
run: | | |
cd proxy-function | |
project_id=$(gcloud config get-value project) | |
project_number=$(gcloud projects describe $project_id --format="value(projectNumber)") | |
ofsted_stub=$(gcloud run services describe ofsted-stub --platform=managed --region=europe-west1 --format="value(status.url)") | |
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 \ | |
--service-account=${project_number}[email protected] \ | |
--set-env-vars ENDPOINT_SERVICE=${ofsted_stub},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 |