Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on:
push:

jobs:
container:
permissions:
packages: write
uses: ./.github/workflows/container.yml

production-container:
permissions:
contents: read
Expand All @@ -17,6 +12,14 @@ jobs:
secrets:
GU_RIFF_RAFF_ROLE_ARN: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

container:
permissions:
packages: write
needs: [production-container]
uses: ./.github/workflows/container.yml
with:
production-image-digest: ${{ needs.production-container.outputs.imageDigest }}
Comment on lines +15 to +21

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This container step is what runs cdk synth. This container is published to GitHub Packages and is used by the Commercial CI checks. I think there's an opportunity to simplify CI (as a separate task) by having the Commercial CI checks use the "production container". This would mean running cdk synth in a discrete step too, for improved readability.


prettier:
uses: ./.github/workflows/prettier.yml

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# Commercial rely on a container image built from the main branch with the tag 'main'
on:
workflow_call:
inputs:
production-image-digest:
description: 'Digest of image pushed to AWS ECR to run on AWS ECS. Gets used by `cdk synth`.'
required: true
type: string
outputs:
container-image:
description: 'The generated container image path'
Expand Down Expand Up @@ -30,6 +35,8 @@ jobs:
echo 'export const GIT_COMMIT_HASH = "${{ github.sha }}";' > src/server/prout.ts

- name: Generate production bundle
env:
IMAGE_DIGEST: ${{ inputs.production-image-digest }}
run: make riffraff-bundle
working-directory: dotcom-rendering

Expand Down
13 changes: 11 additions & 2 deletions dotcom-rendering/cdk/bin/cdk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { App } from 'aws-cdk-lib';
import { InstanceClass, InstanceSize, InstanceType } from 'aws-cdk-lib/aws-ec2';
import type { RenderingCDKStackProps } from '../lib/renderingStack';
import { RenderingCDKStack } from '../lib/renderingStack';

const cdkApp = new App();
Expand Down Expand Up @@ -96,13 +97,21 @@ new RenderingCDKStack(cdkApp, 'FaciaRendering-PROD', {
});

/** Tag pages */
new RenderingCDKStack(cdkApp, 'TagPageRendering-CODE', {
export const TagPageRenderingPropsCODE: RenderingCDKStackProps = {
guApp: 'tag-page-rendering',
stage: 'CODE',
domainName: 'tag-page-rendering.code.dev-guardianapis.com',
scaling: { minimumInstances: 1, maximumInstances: 3 },
instanceType: InstanceType.of(InstanceClass.T4G, InstanceSize.SMALL),
});
imageIdentifier: process.env.IMAGE_DIGEST ?? 'DEV',
};

new RenderingCDKStack(
cdkApp,
'TagPageRendering-CODE',
TagPageRenderingPropsCODE,
);

new RenderingCDKStack(cdkApp, 'TagPageRendering-PROD', {
guApp: 'tag-page-rendering',
stage: 'PROD',
Expand Down
Loading
Loading