Skip to content

Commit

Permalink
Configure environment workflows. (#11)
Browse files Browse the repository at this point in the history
* Configure environment workflows.
Note: reusable workflows don't support environments.
for this reason main will not use environments.

* Pass environtment as an input to the reusable workflow
  • Loading branch information
cru-Luis-Rodriguez authored Oct 29, 2024
1 parent 267f5f8 commit cc7be77
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build-deploy-cloudrun-function.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- main
- staging
paths:
- 'fivetran-trigger/**'
workflow_dispatch:
Expand All @@ -18,15 +17,9 @@ jobs:
build_and_deploy:

uses: CruGlobal/.github/.github/workflows/build-deploy-cloudrun-function.yml@gcp-cloudrun #temporarily using branch for testing
secrets:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
GCP_SERVICE_ACCOUNT_EMAIL: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }}
RUN_SERVICE_ACCOUNT: ${{ secrets.RUN_SERVICE_ACCOUNT }}
GCP_REGION: ${{ secrets.GCP_REGION }}
with:
function_name: ${{ github.event.inputs.function_name }}
entry_point: hello_http
runtime: python312
environment: production

33 changes: 33 additions & 0 deletions .github/workflows/build-deploy-cloudrun-function_poc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Deploy Cloudrun Function POC

on:
push:
branches:
- poc
paths:
- 'fivetran-trigger/**'
workflow_dispatch:
inputs:
function_name:
description: 'The name of the Cloud Function to deploy'
required: true
default: 'fivetran-trigger'
entry_point:
description: 'The python function serving as the entry point'
required: true
default: 'hello_http'
runtime:
description: 'The function runtime'
required: true
default: 'python312'

jobs:
build_and_deploy:

uses: CruGlobal/.github/.github/workflows/build-deploy-cloudrun-function.yml@gcp-cloudrun #temporarily using branch for testing
with:
function_name: ${{ github.event.inputs.function_name }}
entry_point: hello_http
runtime: python312
environment: poc

33 changes: 33 additions & 0 deletions .github/workflows/build-deploy-cloudrun-function_staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build & Deploy Cloudrun Function Staging

on:
push:
branches:
- staging
paths:
- 'fivetran-trigger/**'
workflow_dispatch:
inputs:
function_name:
description: 'The name of the Cloud Function to deploy'
required: true
default: 'fivetran-trigger'
entry_point:
description: 'The python function serving as the entry point'
required: true
default: 'hello_http'
runtime:
description: 'The function runtime'
required: true
default: 'python312'

jobs:
build_and_deploy:

uses: CruGlobal/.github/.github/workflows/build-deploy-cloudrun-function.yml@gcp-cloudrun #temporarily using branch for testing
with:
function_name: ${{ github.event.inputs.function_name }}
entry_point: hello_http
runtime: python312
environment: staging

0 comments on commit cc7be77

Please sign in to comment.