@toptal/davinci-workflow
v2.0.33
Published
GH Workflow generator package for frontend applications
Downloads
1,123
Maintainers
Readme
@toptal/davinci-workflow
Generates Github (GH) Workflows
Usage
Use it by installing yarn add @toptal/davinci-workflow
in your project.
Create named workflow
Creates a new GH workflow in /.github/workflow
directory.
davinci-workflow new-workflow [workflow-name]
Arguments:
workflow-name
- the name of the GH workflow to create
GH Workflows
alpha-package
Executes script to publish alpha version of package to NPM
Example:
davinci-workflow new-workflow alpha-package
Description:
it triggers build-publish-alpha-package GH Action.
Example of usage:
Write a new comment in PR @toptal-bot run package:alpha-release
typecheck
Checks an App on Typescript issues
Example:
davinci-workflow new-workflow typecheck
Description:
it triggers typecheck
GH Action
lint
Checks an App for lint issues
Example:
davinci-workflow new-workflow lint
Description:
it triggers lint
GH Action
unit-tests
Conducts unit tests
Example:
davinci-workflow new-workflow unit-tests
Description:
it triggers unit-tests
GH Action
integration-tests
Conducts integration tests in a project using Cypress.
Example:
davinci-workflow new-workflow integration-tests
Description:
it triggers integration-tests
GH Action
danger
Checks if the PR title and commit messages comply with Toptal's standards
Example:
davinci-workflow new-workflow danger
Description:
it triggers danger
GH Action
deploy-temploy
Builds & Deploys application to Temploy
Example:
davinci-workflow new-workflow deploy-temploy
Description:
it creates a new instance of Docker image, pushes it to cloud and triggers an appropriate Jenkins job to deploy the image to temploy.
Example of usage:
Write a new comment in PR @toptal-bot run temploy
deploy-storybook-temploy
Builds & Deploys storybook to Temploy
Example:
davinci-workflow new-workflow deploy-storybook-temploy
Description:
it creates a new instance of Storybook Docker image, pushes it to cloud and triggers an appropriate Jenkins job to deploy the image to temploy.
Example of usage:
Write a new comment in PR @toptal-bot run storybook-temploy
deploy-storybook-staging
Builds & Deploys Storybook to staging
Example:
davinci-workflow new-workflow deploy-storybook-staging
Description:
This GH Workflow may start in one of the following cases:
- Merging PR to master/main branch
- Performing GH Workflow from
actions
tab: chooseDeploy Storybook to Staging
GH Workflow and provide a commit SHA
It triggers Jenkins job to deploy Storybook to staging
deploy
Performs docker image build and deployment to staging/production environment
Example:
davinci-workflow new-workflow deploy
Description:
performs docker image build and deployment to staging/production environment. Consists of three Workflows:
Deploy
(davinci-deploy.yml)- it's triggered when PR is merged to
master
ormain
branch - It builds and pushes a new instance of Docker image to google cloud
- if
davinci.yml
is present in the root folder:- and
deploy_staging
key is set to true then triggersDeploy to Staging
GH Workflow - and
deploy
key is set to true then triggersDeploy to Production
GH Workflow
- and
- it's triggered when PR is merged to
Deploy to staging
(davinci-deploy-staging.yml)- Triggers Jenkins job for deployment to staging environment
- how to trigger the Workflow manually:
- add a new comment:
@toptal-bot run deploy-staging
in a PR. It will trigger a new GH Workflow. The latest commit in the PR branch will be taken to build a docker image. - In the
actions
tab, chooseDeploy to Staging
GH Workflow and provide a commit SHA
- add a new comment:
Deploy to production
(davinci-deploy-production.yml)- Triggers Jenkins job for deployment to production environment
- how to trigger the Workflow manually:
- In the
actions
tab, chooseDeploy to Production
GH Workflow and provide a commit SHA
- In the
- Find out more about how deployment works in confluence
affected-packages
Displays affected packages by changes in a PR as a graph. The graph is printed as a PR comment.
Example:
davinci-workflow new-workflow affected-packages
Description:
Prerequisities:
- You need to have
@toptal/davinci-monorepo
package version>=6.8.0
installed in your project - The secret
GCR_ACCOUNT_KEY
has to have permission to upload files to GCS buckettoptal-ci-artifacts
. Ask ci team to help with permissions - the
davinci-affected-packages.yml
workflow needs to be merged to master before you can use it
Generate the workflow:
davinci-workflow new-workflow affected-packages
Use the workflow:
Write @toptal-bot generate graph:affected
in a PR to trigger the workflow
It uses davinci-monorepo graph generate
command from @toptal/davinci-monorepo
package.