Skip to content

Commit

Permalink
ci: add docker setup steps to support arm64 and amd64 imagebuilds in …
Browse files Browse the repository at this point in the history
…gh actions
  • Loading branch information
dannysteenman committed Oct 22, 2024
1 parent 05a9adf commit 9181fbf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/cdk-deploy-dev-branch.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .github/workflows/cdk-deploy-dev.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .github/workflows/cdk-deploy-test.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 18 additions & 1 deletion src/bin/cicd-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ function createCdkDeploymentWorkflow(

const commonWorkflowSteps = getCommonWorkflowSteps(account, region, githubDeployRole, nodeVersion);

const dockerSetupSteps = [
{
name: 'Setup QEMU',
uses: 'docker/setup-qemu-action@v3',
with: {
platforms: 'arm64,amd64',
},
},
{
name: 'Setup Docker Buildx',
uses: 'docker/setup-buildx-action@v3',
},
];

const deploymentSteps = [
{
name: `Run CDK synth for the ${env.toUpperCase()} environment`,
Expand All @@ -82,6 +96,9 @@ function createCdkDeploymentWorkflow(
{
name: `Deploy CDK to the ${env.toUpperCase()} environment on AWS account ${account}`,
run: deployForBranch ? `npm run branch:${env}:deploy` : `npm run ${env}:deploy`,
env: {
DOCKER_BUILDKIT: '1',
},
},
];

Expand All @@ -90,7 +107,7 @@ function createCdkDeploymentWorkflow(
name: `Deploy CDK stacks to ${env} AWS account${deployForBranch ? ' (Branch)' : ''}`,
runsOn: COMMON_RUNS_ON,
permissions: COMMON_WORKFLOW_PERMISSIONS,
steps: [...commonWorkflowSteps, ...deploymentSteps],
steps: [...commonWorkflowSteps, ...dockerSetupSteps, ...deploymentSteps],
},
});

Expand Down

0 comments on commit 9181fbf

Please sign in to comment.