Skip to content

Commit

Permalink
Merge pull request #230 from hyeeyoung/dev
Browse files Browse the repository at this point in the history
release 1.2.0
  • Loading branch information
hyejungg authored Nov 28, 2022
2 parents 4bd5f64 + ea50db9 commit e94c6f5
Show file tree
Hide file tree
Showing 34 changed files with 2,627 additions and 598 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/developDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Server Development Server CI&CD Work Flow
on:
push:
branches:
- dev

jobs:
devlop_CICD:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.13.2] # 개발환경과 동일하게 맞춤

steps:
# 브랜치에 checkout해 코드를 가져온다
- name: Checkout source code.
uses: actions/checkout@v2

# node 설치 및 버전 확인한다.
- name: Node.js ${{ matrix.node-version }} install
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Check Npm -v
run: npm -v

# npm ci를 통해 npm install 진행
- name: Npm CI
run: npm ci

#lint 통과 확인
- name: Check ESLint
run: npm run lint

# .env 파일 생성
- name: Create .env file
run: |
touch .env
echo PORT=${{ secrets.PORT }} >> .env
echo DB_DEV_HOST=${{ secrets.DB_DEV_HOST }} >> .env
echo DB_DEV_USER=${{ secrets.DB_DEV_USER }} >> .env
echo DB_DEV_PASSWORD=${{ secrets.DB_DEV_PASSWORD }} >> .env
echo DB_DEV_NAME=${{ secrets.DB_DEV_NAME }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo WISHBOARD_GMAIL_ID=${{ secrets.WISHBOARD_GMAIL_ID }} >> .env
echo WISHBOARD_GMAIL_PW=${{ secrets.WISHBOARD_GMAIL_PW }} >> .env
echo JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} >> .env
echo SLACK_API_TOKEN=${{ secrets.SLACK_API_TOKEN }} >> .env
echo AWS_ACCESS_KEY=${{ secrets.AWS_S3_IMAGE_ACCESS_KEY }} >> .env
echo AWS_SECRET_KEY=${{ secrets.AWS_S3_IMAGE_SECRET_KEY }} >> .env
echo BUCKET_NAME=${{ secrets.AWS_S3_IMAGE_BUCKET_NAME_DEV }} >> .env
# 빌드하여 S3에 업로드
- name: Run build (dev)
run: |
npm run build --if-present
# S3에 빌드 파일 저장
- name: zip file
run: zip -r wishboard-dev.zip ./dist ./scripts ./appspec.yml

- name: AWS configure credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_DEPLOY_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DEPLOY_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2

- name: upload to S3
run: aws s3 cp --region ap-northeast-2 ./wishboard-dev.zip s3://wishboard-dev-build/deploy/

- name: deploy with AWS codeDeploy
run: aws deploy create-deployment
--application-name wishboard-dev-codedeploy
--deployment-config-name CodeDeployDefault.OneAtATime
--deployment-group-name GROUP
--s3-location bucket=wishboard-dev-build,bundleType=zip,key=deploy/wishboard-dev.zip
62 changes: 62 additions & 0 deletions .github/workflows/prCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Server PR Check Work Flow
on:
pull_request:
branches:
- main
- dev

jobs:
PR_Check:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.13.2] # 개발환경과 동일하게 맞춤

steps:
# 브랜치에 checkout해 코드를 가져온다
- name: Checkout source code.
uses: actions/checkout@v2

# node 설치 및 버전 확인한다.
- name: Node.js ${{ matrix.node-version }} install
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Check Npm -v
run: npm -v

# npm ci를 통해 npm install 진행
- name: Npm CI
run: npm ci

#lint 통과 확인
- name: Check ESLint
run: npm run lint

# .env 파일 생성
- name: Create .env file
run: |
touch .env
echo PORT=${{ secrets.PORT }} >> .env
echo DB_HOST=${{ secrets.DB_DEV_HOST }} >> .env
echo DB_USER=${{ secrets.DB_DEV_USER }} >> .env
echo DB_PASSWORD=${{ secrets.DB_DEV_PASSWORD }} >> .env
echo DB_NAME=${{ secrets.DB_DEV_NAME }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo WISHBOARD_GMAIL_ID=${{ secrets.WISHBOARD_GMAIL_ID }} >> .env
echo WISHBOARD_GMAIL_PW=${{ secrets.WISHBOARD_GMAIL_PW }} >> .env
echo JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} >> .env
echo SLACK_API_TOKEN=${{ secrets.SLACK_API_TOKEN }} >> .env
echo AWS_ACCESS_KEY=${{ secrets.AWS_S3_IMAGE_ACCESS_KEY }} >> .env
echo AWS_SECRET_KEY=${{ secrets.AWS_S3_IMAGE_SECRET_KEY }} >> .env
echo BUCKET_NAME=${{ secrets.AWS_S3_IMAGE_BUCKET_NAME_DEV }} >> .env
- name: Run build
run: |
echo NODE_ENV="development" >> .env
npm run build --if-present
76 changes: 76 additions & 0 deletions .github/workflows/productDeploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Server Production Server CI&CD Work Flow
on:
push:
branches:
- main

jobs:
prod_CICD:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.13.2] # 개발환경과 동일하게 맞춤

steps:
# 브랜치에 checkout해 코드를 가져온다
- name: Checkout source code.
uses: actions/checkout@v2

# node 설치 및 버전 확인한다.
- name: Node.js ${{ matrix.node-version }} install
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Check Npm -v
run: npm -v

# npm ci를 통해 npm install 진행
- name: Npm CI
run: npm ci

#lint 통과 확인
- name: Check ESLint
run: npm run lint

# .env 파일 생성
- name: Create .env file
run: |
touch .env
echo PORT=${{ secrets.PORT }} >> .env
echo DB_HOST=${{ secrets.DB_HOST }} >> .env
echo DB_USER=${{ secrets.DB_USER }} >> .env
echo DB_PASSWORD=${{ secrets.DB_PASSWORD }} >> .env
echo DB_NAME=${{ secrets.DB_NAME }} >> .env
echo DB_PORT=${{ secrets.DB_PORT }} >> .env
echo WISHBOARD_GMAIL_ID=${{ secrets.WISHBOARD_GMAIL_ID }} >> .env
echo WISHBOARD_GMAIL_PW=${{ secrets.WISHBOARD_GMAIL_PW }} >> .env
echo JWT_SECRET_KEY=${{ secrets.JWT_SECRET_KEY }} >> .env
echo SLACK_API_TOKEN=${{ secrets.SLACK_API_TOKEN }} >> .env
echo AWS_ACCESS_KEY=${{ secrets.AWS_S3_IMAGE_ACCESS_KEY }} >> .env
echo AWS_SECRET_KEY=${{ secrets.AWS_S3_IMAGE_SECRET_KEY }} >> .env
echo BUCKET_NAME=${{ secrets.AWS_S3_IMAGE_BUCKET_NAME }} >> .env
# 빌드하여 S3에 업로드
- name: Run build (main)
run: |
npm run build:production --if-present
- name: Copy ecosystem.config.js
run: |
cp ./ecosystem.config.js ./dist
# S3에 빌드 파일 저장
- name: Build file upload to S3 and PM2 script
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
dist s3://wishboard-server-build
121 changes: 0 additions & 121 deletions .github/workflows/serverCICD.yml

This file was deleted.

Loading

0 comments on commit e94c6f5

Please sign in to comment.