Skip to content

Latest commit

 

History

History
96 lines (78 loc) · 3.44 KB

openapi_update.md

File metadata and controls

96 lines (78 loc) · 3.44 KB

Openapi Update Workflow

This workflow generates an openapi configuration and deploys/redeploys GCP endpoints. Make sure to review the actions below to configure your project properly.

Input Arguments

gcp_project
  • Description: The GCP project name
  • type: string
  • required: true
api_subdomain
  • Description: The subdomain of the api being deployed
  • type: string
  • required: true
default_service_account
  • Description: The service account you want to run the gcloud deployment commands
  • type: string
  • required: true
openapi_dir
  • Description: The directory location of all the openapi templates and configurations
  • type: string
  • default: ./
template
  • Description: The name of the template yaml file
  • type: string
  • default: template.yaml
outfile
  • Description: The name of the outputted Open API file.
  • type: string
  • default: openapi.yaml
environment_key
  • Description: Key in the template to replace with the environment value.
  • type: string
  • default: <environment>
environment_value
  • Description: Value that will replace the environment key in the template.
  • type: string
  • default: production

Secrets

gcp_credentials
  • 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

Example Usage

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 }}

Additional Usage