Class GitHubWorkflow.Builder
- java.lang.Object
-
- io.github.cdklabs.cdkpipelines.github.GitHubWorkflow.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<GitHubWorkflow>
- Enclosing class:
- GitHubWorkflow
@Stability(Stable) public static final class GitHubWorkflow.Builder extends Object implements software.amazon.jsii.Builder<GitHubWorkflow>
A fluent builder forGitHubWorkflow.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GitHubWorkflow.BuilderawsCredentials(AwsCredentialsSecrets awsCredentials)Names of GitHub repository secrets that include AWS credentials for deployment.GitHubWorkflowbuild()GitHubWorkflow.BuilderbuildContainer(ContainerOptions buildContainer)Build container options.GitHubWorkflow.BuildercdkCliVersion(String cdkCliVersion)Version of the CDK CLI to use.static GitHubWorkflow.Buildercreate(software.constructs.Construct scope, String id)GitHubWorkflow.BuilderdockerCredentials(List<? extends DockerCredential> dockerCredentials)The Docker Credentials to use to login.GitHubWorkflow.BuildergitHubActionRoleArn(String gitHubActionRoleArn)A role that utilizes the GitHub OIDC Identity Provider in your AWS account.GitHubWorkflow.BuilderpostBuildSteps(List<? extends JobStep> postBuildSteps)GitHub workflow steps to execute after build.GitHubWorkflow.BuilderpreBuildSteps(List<? extends JobStep> preBuildSteps)GitHub workflow steps to execute before build.GitHubWorkflow.BuilderpreSynthed(Boolean preSynthed)Indicates if the repository already contains a synthesized `cdk.out` directory, in which case we will simply checkout the repo in jobs that require `cdk.out`.GitHubWorkflow.BuilderpublishAssetsAuthRegion(String publishAssetsAuthRegion)Will assume the GitHubActionRole in this region when publishing assets.GitHubWorkflow.Builderrunner(Runner runner)The type of runner to run the job on.GitHubWorkflow.Buildersynth(software.amazon.awscdk.pipelines.IFileSetProducer synth)The build step that produces the CDK Cloud Assembly.GitHubWorkflow.BuilderworkflowName(String workflowName)Name of the workflow.GitHubWorkflow.BuilderworkflowPath(String workflowPath)File path for the GitHub workflow.GitHubWorkflow.BuilderworkflowTriggers(WorkflowTriggers workflowTriggers)GitHub workflow triggers.
-
-
-
Method Detail
-
create
@Stability(Stable) public static GitHubWorkflow.Builder create(software.constructs.Construct scope, String id)
- Parameters:
scope- This parameter is required.id- This parameter is required.- Returns:
- a new instance of
GitHubWorkflow.Builder.
-
synth
@Stability(Stable) public GitHubWorkflow.Builder synth(software.amazon.awscdk.pipelines.IFileSetProducer synth)
The build step that produces the CDK Cloud Assembly.The primary output of this step needs to be the
cdk.outdirectory generated by thecdk synthcommand.If you use a
ShellStephere and you don't configure an output directory, the output directory will automatically be assumed to becdk.out.- Parameters:
synth- The build step that produces the CDK Cloud Assembly. This parameter is required.- Returns:
this
-
awsCredentials
@Stability(Stable) public GitHubWorkflow.Builder awsCredentials(AwsCredentialsSecrets awsCredentials)
Names of GitHub repository secrets that include AWS credentials for deployment.Default: - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`.
- Parameters:
awsCredentials- Names of GitHub repository secrets that include AWS credentials for deployment. This parameter is required.- Returns:
this
-
buildContainer
@Stability(Stable) public GitHubWorkflow.Builder buildContainer(ContainerOptions buildContainer)
Build container options.Default: - GitHub defaults
- Parameters:
buildContainer- Build container options. This parameter is required.- Returns:
this
-
cdkCliVersion
@Stability(Stable) public GitHubWorkflow.Builder cdkCliVersion(String cdkCliVersion)
Version of the CDK CLI to use.Default: - automatic
- Parameters:
cdkCliVersion- Version of the CDK CLI to use. This parameter is required.- Returns:
this
-
dockerCredentials
@Stability(Stable) public GitHubWorkflow.Builder dockerCredentials(List<? extends DockerCredential> dockerCredentials)
The Docker Credentials to use to login.If you set this variable, you will be logged in to docker when you upload Docker Assets.
- Parameters:
dockerCredentials- The Docker Credentials to use to login. This parameter is required.- Returns:
this
-
gitHubActionRoleArn
@Stability(Stable) public GitHubWorkflow.Builder gitHubActionRoleArn(String gitHubActionRoleArn)
A role that utilizes the GitHub OIDC Identity Provider in your AWS account.If supplied, this will be used instead of
awsCredentials.You can create your own role in the console with the necessary trust policy to allow gitHub actions from your gitHub repository to assume the role, or you can utilize the
GitHubActionRoleconstruct to create a role for you.Default: - GitHub repository secrets are used instead of OpenId Connect role.
- Parameters:
gitHubActionRoleArn- A role that utilizes the GitHub OIDC Identity Provider in your AWS account. This parameter is required.- Returns:
this
-
postBuildSteps
@Stability(Stable) public GitHubWorkflow.Builder postBuildSteps(List<? extends JobStep> postBuildSteps)
GitHub workflow steps to execute after build.Default: []
- Parameters:
postBuildSteps- GitHub workflow steps to execute after build. This parameter is required.- Returns:
this
-
preBuildSteps
@Stability(Stable) public GitHubWorkflow.Builder preBuildSteps(List<? extends JobStep> preBuildSteps)
GitHub workflow steps to execute before build.Default: []
- Parameters:
preBuildSteps- GitHub workflow steps to execute before build. This parameter is required.- Returns:
this
-
preSynthed
@Stability(Stable) public GitHubWorkflow.Builder preSynthed(Boolean preSynthed)
Indicates if the repository already contains a synthesized `cdk.out` directory, in which case we will simply checkout the repo in jobs that require `cdk.out`.Default: false
- Parameters:
preSynthed- Indicates if the repository already contains a synthesized `cdk.out` directory, in which case we will simply checkout the repo in jobs that require `cdk.out`. This parameter is required.- Returns:
this
-
publishAssetsAuthRegion
@Stability(Stable) public GitHubWorkflow.Builder publishAssetsAuthRegion(String publishAssetsAuthRegion)
Will assume the GitHubActionRole in this region when publishing assets.This is NOT the region in which the assets are published.
In most cases, you do not have to worry about this property, and can safely ignore it.
Default: "us-west-2"
- Parameters:
publishAssetsAuthRegion- Will assume the GitHubActionRole in this region when publishing assets. This parameter is required.- Returns:
this
-
runner
@Stability(Stable) public GitHubWorkflow.Builder runner(Runner runner)
The type of runner to run the job on.The runner can be either a GitHub-hosted runner or a self-hosted runner.
Default: Runner.UBUNTU_LATEST
- Parameters:
runner- The type of runner to run the job on. This parameter is required.- Returns:
this
-
workflowName
@Stability(Stable) public GitHubWorkflow.Builder workflowName(String workflowName)
Name of the workflow.Default: "deploy"
- Parameters:
workflowName- Name of the workflow. This parameter is required.- Returns:
this
-
workflowPath
@Stability(Stable) public GitHubWorkflow.Builder workflowPath(String workflowPath)
File path for the GitHub workflow.Default: ".github/workflows/deploy.yml"
- Parameters:
workflowPath- File path for the GitHub workflow. This parameter is required.- Returns:
this
-
workflowTriggers
@Stability(Stable) public GitHubWorkflow.Builder workflowTriggers(WorkflowTriggers workflowTriggers)
GitHub workflow triggers.Default: - By default, workflow is triggered on push to the `main` branch and can also be triggered manually (`workflow_dispatch`).
- Parameters:
workflowTriggers- GitHub workflow triggers. This parameter is required.- Returns:
this
-
build
@Stability(Stable) public GitHubWorkflow build()
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<GitHubWorkflow>
-
-