Skip to content

Commit

Permalink
Merge pull request #145 from Together42/develop
Browse files Browse the repository at this point in the history
ci: 운영 프론트 배포
  • Loading branch information
seo-wo committed Dec 20, 2023
2 parents 2624a59 + 18fc968 commit 895e082
Show file tree
Hide file tree
Showing 42 changed files with 1,572 additions and 1,114 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/deploy-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: front-auto-deploy-develop

on:
push:
branches: [develop]

jobs:
deploy-develop:
name: Build, Deploy Develop to S3 bucket
runs-on: [ubuntu-latest]

steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
ref: develop

- name: Setup Python for AWS CLI
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install AWS CLI
run: pip3 install awscli --upgrade --user

- 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_BUCKET_REGION }}
mask-aws-account-id: true

- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Npm Install
run: npm install

- name: Create env file
run: |
touch .env
echo DEPLOY_ADR=${{ secrets.DEPLOY_ADR_DEV }} >> .env
echo IMAGE_SERVER_ADR=${{ secrets.IMAGE_SERVER_ADR }} >> .env
cat .env
- name: Build
run: npm run predeploy

- name: Transfer to S3 for serving static
run: |
aws s3 sync ./dist s3://${{ secrets.AWS_BUCKET_NAME_DEV }} \
--region ${{ secrets.AWS_BUCKET_REGION }} \
--delete
- name: Invalidate cache CloudFront
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID_DEV }} \
--paths "/*"
13 changes: 0 additions & 13 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,6 @@ jobs:
name: Build, Deploy to S3 bucket
runs-on: [ubuntu-latest]

env:
AWS_BUCKET_NAME: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET_REGION: ${{ secrets.AWS_BUCKET_REGION }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
DEPLOY_ADR: ${{ secrets.DEPLOY_ADR }}
IMAGE_SERVER_ADR: ${{ secrets.IMAGE_SERVER_ADR }}

strategy:
matrix:
node-version: [14.15.x]

steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
/dist

.env

/.idea
Loading

0 comments on commit 895e082

Please sign in to comment.