Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:

- if: ${{ steps.cache-api.outputs.cache-hit != 'true' }}
name: Zip application
run: zip -r app.zip . -x ".git/*" ".github/*" "infra/" "docker/" "test/"
run: zip -r app.zip . -x ".git/*" ".github/*" "infra/*" "docker/*" "test/*"

- if: ${{ steps.cache-api.outputs.cache-hit != 'true' }}
name: Upload to S3
run: |
FILE_NAME="app-${{ github.sha }}.zip"
FILE_NAME="app-$(date +%Y-%m-%d_%H:%M)-${{ github.sha }}.zip"
aws s3 cp app.zip s3://$CODE_BUCKET/$FILE_NAME
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV

Expand Down
22 changes: 22 additions & 0 deletions infra/lib/infra-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ export class InfraStack extends cdk.Stack {
resources: [codeBucket.bucketArn, `${codeBucket.bucketArn}/*`],
}),

// Allow publishing frontend artifacts to the dedicated frontend bucket
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['s3:*'],
resources: [
frontendBucket.bucketArn,
`${frontendBucket.bucketArn}/*`,
],
}),

// Allow triggering SSM RunCommand to restart docker on the instance
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
Expand All @@ -444,6 +454,13 @@ export class InfraStack extends cdk.Stack {
actions: ['logs:*'],
resources: ['*'],
}),

// CloudFront permissions
new iam.PolicyStatement({
effect: iam.Effect.ALLOW,
actions: ['cloudfront:CreateInvalidation'],
resources: ['*'],
}),
],
}),
);
Expand Down Expand Up @@ -482,5 +499,10 @@ export class InfraStack extends cdk.Stack {
value: frontendBucket.bucketName,
description: 'S3 bucket for frontend deployment',
});

new cdk.CfnOutput(this, 'CloudFrontDistributionId', {
value: distribution.distributionId,
description: 'CloudFront distribution ID',
});
}
}
4 changes: 2 additions & 2 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ionicapp",
"version": "0.0.3",
"version": "0.0.4",
"description": "",
"author": "",
"private": true,
Expand Down Expand Up @@ -122,4 +122,4 @@
}
]
}
}
}
Loading