jobs:
deploy-service:
uses: flexbase-eng/.github/.github/workflows/deploy.gcr.yml@main
with:
service_name: 'id-poc'
project_id: 'flexbase-api-development'
Input | Type | Default | Required |
---|---|---|---|
service_name | string |
false | true |
project_id | string |
false | true |
- Authenticate with appropriate workload identity provider and service impersonation token auth dance
- set up cloud sdk
- push container to google cloud registry with github sha as tag
- deploy the registered container to the appropriate project namespace
jobs:
generate-typescript-sdk:
uses: flexbase-eng/.github/.github/workflows/openapi.client.generator.yml@main
with:
swagger_url: 'https://petstore3.swagger.io/api/v3/openapi.json'
Input | Type | Default | Required |
---|---|---|---|
swagger_url | string |
https://petstore3.swagger.io/api/v3/openapi.json |
true |
client_type | string |
typescript-axios |
false |
additional_options | string |
supportsES6=true,withNodeImports=true,withInterfaces=true |
false |
- Set up generator tool
- generate client base sdk utilizing the openapi hosted json file
Builds typescript using yarn
jobs:
build:
uses: flexbase-eng/.github/.github/workflows/typescript.build.yml@main
with:
package_folder: output
revision: ${{github.run_number}}
Input | Type | Default | Required |
---|---|---|---|
package_folder | string |
no | |
use_packr | boolean |
false | no |
major_version1 | integer |
no | |
minor_version1 | integer |
no | |
revision1 | integer |
no |
- Yarn install
- Yarn build
- Yarn lint
- Yarn test
- Packr (
use_packr
but be set totrue
) - Store build artifacts
- Store coverage artifacts
Pushes coverage to sonarcloud
coverage:
needs: build
uses: flexbase-eng/.github/.github/workflows/typescript.sonarcloud.yml@main
with:
project_key: flexbase-eng_<repo-name>
secrets: inherit
Input | Type | Default | Required |
---|---|---|---|
project_key | string |
* |
- Retreive coverage artifacts
- Run sonarcloud
Pushes node package to npm under the @flexbase
scope and organization.
Takes the package.json
value and utilizes this with the standard npm publish methodology.
Optional beta
tag as seen below for PR based publishes, to publish a beta version before main branch publish. This is useful if you'd like to test your changes within the package before making a formal release with merge to main
.
publishing a beta on PR with the npm
package management system:
publish:
needs: coverage
uses: flexbase-eng/.github/.github/workflows/typescript.publish.yml@main
with:
tag: beta
package_manager: npm
secrets: inherit
publishing to production with the yarn
package management system:
publish:
needs: coverage
uses: flexbase-eng/.github/.github/workflows/typescript.publish.yml@main
secrets: inherit
Input | Type | Default | Required |
---|---|---|---|
tag | string |
latest | no |
build_artifact | string |
latest | no |
package_manager | string |
yarn | no |
package_visibility | string |
public | no |
- Retreive build artifacts
- Setup yarn
- Publish to npm
Workflow to utilize a common pattern for release notifications when publishing a release via github. Notifier aggregates the release notes and pushes this to a release channel. gha_deployment_failure_url
defines the URL you would like to set for log review of the production deployment failure.
Entire workflow for reference to add to indidivual repository.
name: Notify Slack Release Channel
on:
release:
types: [released]
workflow_dispatch:
prod-notify:
needs: <production deploy worfklow name>
uses: flexbase-eng/.github/.github/workflows/release.notifier.yml@main
with:
gha_deployment_failure_url: https://github.com/flexbase-eng/flexbase-web/actions/workflows/deploy-prod.yml
production_url: https://www.flexbase.app
release_title: Flexbase Web
secrets: inherit
or minimally:
name: Notify Slack Release Channel
on:
release:
types: [released]
workflow_dispatch:
prod-notify:
needs: <production deploy worfklow name>
uses: flexbase-eng/.github/.github/workflows/release.notifier.yml@main
with:
gha_deployment_failure_url: https://github.com/flexbase-eng/flexbase-web/actions/workflows/deploy-prod.yml
secrets: inherit
Input | Type | Default | Required |
---|---|---|---|
gha_deployment_failure_url | string |
none | yes |
production_url | string |
https://www.flexbase.app | no |
release_title | string |
repository.name | no |
Assumptions: production deployment triggered based on published release notes. Deployment has completed (either succeeded or failed).
- Get the repositories latest published release
- if success, post slack notification to release channel
- if failure, post slack notificaiton to release channel with the
gha_deployment_failure_url
to help developers identify root cause.
Drafts merged PR's into a github release draft format, aggregating labels to various sections.
Entire worfklow for reference to add to individual repository.
name: Release draft workflow
on:
push:
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]
update_release_draft:
uses: flexbase-eng/.github/.github/workflows/release.drafter.yml@main
secrets: inherit
Input | Type | Default | Required |
---|
- on merge to
main
, updates Release draft
- learn more about github release management here: https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository
- Release drafter github action: https://github.com/release-drafter/release-drafter
Runs Postman API tests and outputs junit and html reports.
Entire worfklow for reference to add to individual repository.
name: Run Postman API Tests Workflow
on:
push:
branches: 'main'
jobs:
run-postman-api-tests:
uses: flexbase-eng/.github/.github/workflows/postman.api.test.yml@main
with:
postman_collection_directory: <your postman collection directory goes here>
postman_environment_directory: <your post man environment directory goes here>
Input | Type | Default | Required |
---|---|---|---|
postman_collection_directory | string | none | yes |
postman_environment_directory | string | none | yes |
- Determine the directory for Postman collection where API tests are located
- Determine the directory for Postman environment file needed to run the tests