This workflow generates an openapi configuration and deploys/redeploys GCP endpoints. Make sure to review the actions below to configure your project properly.
- GCloud SDK setup action: setup_gcloud
- Openapi config generation action: compile_openapi action
- GCP Endpoints deployement action: configure_gcp_endpoints action.
- Description: The GCP project name
type
:string
required
:true
- Description: The subdomain of the api being deployed
type
:string
required
:true
- Description: The service account you want to run the gcloud deployment commands
type
:string
required
:true
- Description: The directory location of all the openapi templates and configurations
type
:string
default
:./
- Description: The name of the template yaml file
type
:string
default
:template.yaml
- Description: The name of the outputted Open API file.
type
:string
default
:openapi.yaml
- Description: Key in the template to replace with the environment value.
type
:string
default
:<environment>
- Description: Value that will replace the environment key in the template.
type
:string
default
:production
- Description: A github secret containing the json api key from google for the desired service account that will be issuing the commands from the
gcloud
cli. - References the repo's available secrets and the github group's (i.e.
Auddia
) available secrets - If the needed credentials secret doesnt exist and you need to add one follow this guide to generate the json value that you will assign the secret. NOTE: You need admin privileges to add a secret to a repo or group
on:
push:
branches:
- staging
- production
jobs:
discovery_api_update_staging:
name: Openapi Update Staging Deployment.
if: github.ref == 'refs/heads/staging'
uses: Auddia/cicd/.github/workflows/openapi_update.yml@<tag>
with:
gcp_project: 'vodacast-staging'
api_subdomain: 'discovery.vodacast-staging.auddia.services'
default_service_account: "[email protected]"
openapi_dir: './api/data/openapi'
environment_value: 'staging'
secrets:
gcp_credentials: ${{ secrets.VODACAST_STAGING_GCP_CREDENTIALS }}
discovery_api_update_production:
name: Openapi Update Production Deployment
if: github.ref == 'refs/heads/production'
uses: Auddia/cicd/.github/workflows/openapi_update.yml@<tag>
with:
gcp_project: 'vodacast'
api_subdomain: 'discovery.vodacast.auddia.services'
default_service_account: '[email protected]'
openapi_dir: './api/data/openapi'
environment_value: 'production'
secrets:
gcp_credentials: ${{ secrets.VODACAST_GCP_CREDENTIALS }}