-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: .gitignore 수정 * chore(BE): PR workflow paths 추가 * chore: PR workflow 추가 * chore: dev, prod 배포 workflow 추가 * rename: workflows dev -> staging 이름 변경 * chore: workflows name 변경 * chore: S3 버킷 환경별로 분리 * chore: CloudFront ID 환경별로 분리
- Loading branch information
Showing
7 changed files
with
198 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Frontend PR CI | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- frontend/** | ||
- .github/** | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: yarn | ||
cache-dependency-path: "**/yarn.lock" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Build | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Frontend Production Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- frontend/** | ||
- .github/** | ||
|
||
jobs: | ||
deploy: | ||
env: | ||
ENV_PATH: .env.production | ||
environment: production | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: yarn | ||
cache-dependency-path: "**/yarn.lock" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
- name: Create .env file | ||
run: | | ||
touch ${{ env.ENV_PATH }} | ||
cat ${{ env.ENV_PATH }} | ||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_S3_REGION }} | ||
|
||
- name: Deploy to S3 | ||
run: | | ||
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET_NAME_FRONTEND_PROD }} \ | ||
--delete \ | ||
--acl public-read \ | ||
--cache-control "max-age=0, no-cache, no-store, must-revalidate" | ||
- name: Invalidate CloudFront Cache | ||
run: aws cloudfront create-invalidation \ | ||
--distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_PROD }} \ | ||
--paths "/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Frontend Staging Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
paths: | ||
- frontend/** | ||
- .github/** | ||
|
||
jobs: | ||
deploy: | ||
env: | ||
ENV_PATH: .env.staging | ||
environment: staging | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./frontend | ||
|
||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
cache: yarn | ||
cache-dependency-path: "**/yarn.lock" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node-modules- | ||
- name: Create .env file | ||
run: | | ||
touch ${{ env.ENV_PATH }} | ||
cat ${{ env.ENV_PATH }} | ||
- name: Install Dependencies | ||
run: yarn install --immutable | ||
|
||
- name: Build | ||
run: yarn build | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ secrets.AWS_S3_REGION }} | ||
|
||
- name: Deploy to S3 | ||
run: | | ||
aws s3 sync ./dist s3://${{ secrets.AWS_S3_BUCKET_NAME_FRONTEND_STAGING }} \ | ||
--delete \ | ||
--acl public-read \ | ||
--cache-control "max-age=0, no-cache, no-store, must-revalidate" | ||
- name: Invalidate CloudFront Cache | ||
run: aws cloudfront create-invalidation \ | ||
--distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_STAGING }} \ | ||
--paths "/*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters