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 deployment action: configure_gcp_endpoints action
This action is available on tags v0
and above.
- Description: The GCP project name
type
:string
required
:true
- Description: The subdomain of the api being deployed
type
:string
required
:true
- Description: Name of the api
type
:string
required
:false
default
:''
- You must specify this field or the
function_name
field
- Description: Name of the GCP function
type
:string
required
:false
default
:''
- You must specify this field or the
api_name
field
- Description: Name of the GCP endpoints service name
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: 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 doesn't 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
api_name: discovery-api
endpoints_service_name: discovery-endpoints-cloudrun-service
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
api_name: discovery-api
endpoints_service_name: discovery-endpoints-cloudrun-service
default_service_account: [email protected]
openapi_dir: ./api/data/openapi
environment_value: production
secrets:
gcp_credentials: ${{ secrets.VODACAST_GCP_CREDENTIALS }}
- [Tests](FILL IN)