Skip to content

Commit 77f70e3

Browse files
Merge pull request #12 from ForeverYoung1208/fix/current-fix
Fix/current fix
2 parents 8c127a6 + c27764c commit 77f70e3

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

.github/workflows/deploy-dev.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ jobs:
4949

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

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

infra/lib/infra-stack.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,16 @@ export class InfraStack extends cdk.Stack {
419419
resources: [codeBucket.bucketArn, `${codeBucket.bucketArn}/*`],
420420
}),
421421

422+
// Allow publishing frontend artifacts to the dedicated frontend bucket
423+
new iam.PolicyStatement({
424+
effect: iam.Effect.ALLOW,
425+
actions: ['s3:*'],
426+
resources: [
427+
frontendBucket.bucketArn,
428+
`${frontendBucket.bucketArn}/*`,
429+
],
430+
}),
431+
422432
// Allow triggering SSM RunCommand to restart docker on the instance
423433
new iam.PolicyStatement({
424434
effect: iam.Effect.ALLOW,
@@ -444,6 +454,13 @@ export class InfraStack extends cdk.Stack {
444454
actions: ['logs:*'],
445455
resources: ['*'],
446456
}),
457+
458+
// CloudFront permissions
459+
new iam.PolicyStatement({
460+
effect: iam.Effect.ALLOW,
461+
actions: ['cloudfront:CreateInvalidation'],
462+
resources: ['*'],
463+
}),
447464
],
448465
}),
449466
);
@@ -482,5 +499,10 @@ export class InfraStack extends cdk.Stack {
482499
value: frontendBucket.bucketName,
483500
description: 'S3 bucket for frontend deployment',
484501
});
502+
503+
new cdk.CfnOutput(this, 'CloudFrontDistributionId', {
504+
value: distribution.distributionId,
505+
description: 'CloudFront distribution ID',
506+
});
485507
}
486508
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ionicapp",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "",
55
"author": "",
66
"private": true,
@@ -122,4 +122,4 @@
122122
}
123123
]
124124
}
125-
}
125+
}

0 commit comments

Comments
 (0)