Skip to content

Commit 3719364

Browse files
committed
feat: frontend / admin 배포를 병렬로 진행하도록 수정
1 parent 1dbc360 commit 3719364

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/workflows/deploy.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Deploy to AWS S3
22

33
concurrency:
4-
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
4+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}-${{ github.event.inputs.WORKFLOW_PHASE || 'dev' }}
55
cancel-in-progress: true
66

77
on:
@@ -15,14 +15,6 @@ on:
1515
options:
1616
- dev
1717
- prod
18-
APPLICATION:
19-
description: "Application to deploy"
20-
required: true
21-
default: pyconkr
22-
type: choice
23-
options:
24-
- pyconkr-frontend
25-
- pyconkr-admin
2618
push:
2719
branches:
2820
- "main"
@@ -42,7 +34,17 @@ jobs:
4234
AWS_S3_PYCONKR_ADMIN_BUCKET: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_S3_PYCONKR_ADMIN_BUCKET_DEV || secrets.AWS_S3_PYCONKR_ADMIN_BUCKET_PROD }}
4335
AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID_DEV || secrets.AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID_PROD }}
4436
AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID: ${{ (github.event_name == 'workflow_dispatch' && inputs.WORKFLOW_PHASE || 'dev') == 'dev' && secrets.AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID_DEV || secrets.AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID_PROD }}
45-
DEPLOY_TARGET_APPLICATION: ${{ (github.event_name == 'workflow_dispatch' && inputs.APPLICATION || 'pyconkr-frontend') == 'pyconkr-frontend' && 'pyconkr' || 'pyconkr-admin' }}
37+
38+
strategy:
39+
matrix:
40+
application: [pyconkr, pyconkr-admin]
41+
include:
42+
- application: pyconkr
43+
aws_s3_bucket_key: AWS_S3_PYCONKR_FRONTEND_BUCKET
44+
aws_cloudfront_distribution_key: AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID
45+
- application: pyconkr-admin
46+
aws_s3_bucket_key: AWS_S3_PYCONKR_ADMIN_BUCKET
47+
aws_cloudfront_distribution_key: AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID
4648

4749
steps:
4850
- uses: actions/checkout@master
@@ -66,8 +68,8 @@ jobs:
6668

6769
- run: mkdir -p dist
6870

69-
- run: pnpm build:@apps/${{ env.DEPLOY_TARGET_APPLICATION }} ${{ env.BUMP_RULE }} && cp -r apps/${{ env.DEPLOY_TARGET_APPLICATION }}/dist/* dist/
71+
- run: pnpm build:@apps/${{ matrix.application }} ${{ env.BUMP_RULE }} && cp -r apps/${{ matrix.application }}/dist/* dist/
7072

71-
- run: aws s3 cp --recursive ./dist s3://${{ (github.event_name == 'workflow_dispatch' && inputs.APPLICATION || 'pyconkr-frontend') == 'pyconkr-frontend' && env.AWS_S3_PYCONKR_FRONTEND_BUCKET || env.AWS_S3_PYCONKR_ADMIN_BUCKET }}/
73+
- run: aws s3 cp --recursive ./dist s3://${{ secrets[matrix.aws_s3_bucket_key] }}/
7274

73-
- run: aws cloudfront create-invalidation --distribution-id ${{ (github.event_name == 'workflow_dispatch' && inputs.APPLICATION || 'pyconkr-frontend') == 'pyconkr-frontend' && env.AWS_CLOUDFRONT_PYCONKR_FRONTEND_DISTRIBUTION_ID || env.AWS_CLOUDFRONT_PYCONKR_ADMIN_DISTRIBUTION_ID }} --paths "/*"
75+
- run: aws cloudfront create-invalidation --distribution-id ${{ secrets[matrix.aws_cloudfront_distribution_key] }} --paths "/*"

0 commit comments

Comments
 (0)