-
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.
Merge branch 'develop' into feat/178
- Loading branch information
Showing
19 changed files
with
257 additions
and
198 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,86 @@ | ||
name: Teammate Dev CI/CD | ||
|
||
on: | ||
pull_request: # pull request -> merge 가 되었을 때 Github Action 실행! | ||
types: [closed] | ||
workflow_dispatch: # 수동 실행도 가능하도록 함 | ||
pull_request: # pull request -> merge 가 되었을 때 Github Action 실행! | ||
types: [closed] | ||
workflow_dispatch: # 수동 실행도 가능하도록 함 | ||
|
||
jobs: | ||
build: | ||
# pull 요청이 dev에 merge 되었을 때 아래 steps를 실행 | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' | ||
build: | ||
# pull 요청이 dev에 merge 되었을 때 아래 steps를 실행 | ||
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop' | ||
|
||
runs-on: ubuntu-latest # 우분투 최신 버전으로 실행 | ||
runs-on: ubuntu-latest # 우분투 최신 버전으로 실행 | ||
|
||
strategy: | ||
matrix: | ||
node-version: ["18.x"] # 노드 버전 지정! 여러 개도 가능! ['18.x', '14.x'] 요렇게 | ||
strategy: | ||
matrix: | ||
node-version: ["20.x"] # 노드 버전 지정! 여러 개도 가능! ['18.x', '14.x'] 요렇게 | ||
|
||
steps: | ||
# build 할 코드를 가져옴 (코드 checkout - github에서 제공해주는 checkout@v3 사용) | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
steps: | ||
# build 할 코드를 가져옴 (코드 checkout - github에서 제공해주는 checkout@v3 사용) | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# Node.js 세팅 | ||
- name: Set up Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
# Node.js 세팅 | ||
- name: Set up Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
|
||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
# dependencies 설치, test and build | ||
- name: Install dependencies | ||
run: npm ci # dependencies 설치 npm ci, npm install 모두 다 됨! | ||
# dependencies 설치, test and build | ||
- name: Install dependencies | ||
run: npm ci # dependencies 설치 npm ci, npm install 모두 다 됨! | ||
|
||
- name: Run Build | ||
run: npm run build # 빌드 | ||
- name: Run Build | ||
run: npm run build # 빌드 | ||
|
||
# 배포 패키지 생성 | ||
- name: Generate deployment package | ||
run: | | ||
cp -R .platform dist | ||
cp package.json dist/package.json | ||
cp package-lock.json dist/package-lock.json | ||
cp Procfile dist/Procfile | ||
cd dist | ||
zip -r deploy.zip . | ||
# 배포 패키지 생성 | ||
- name: Generate deployment package | ||
run: | | ||
cp -R .platform dist | ||
cp package.json dist/package.json | ||
cp package-lock.json dist/package-lock.json | ||
cp Procfile dist/Procfile | ||
cd dist | ||
zip -r deploy.zip . | ||
# 생성한 deploy.zip 파일 내부 확인용! | ||
- name: Get Zip Inside | ||
run: zipinfo -1 dist/deploy.zip | ||
# 생성한 deploy.zip 파일 내부 확인용! | ||
- name: Get Zip Inside | ||
run: zipinfo -1 dist/deploy.zip | ||
|
||
# 현재 시간 얻기 (Build 시점의 시간 얻기) | ||
- name: Get current time | ||
uses: 1466587594/get-current-time@v2 | ||
id: current-time | ||
with: | ||
format: YYYY-MM-DDTHH-mm-ss | ||
utcOffset: "+09:00" # 한국 시간 고려 | ||
# 현재 시간 얻기 (Build 시점의 시간 얻기) | ||
- name: Get current time | ||
uses: 1466587594/get-current-time@v2 | ||
id: current-time | ||
with: | ||
format: YYYY-MM-DDTHH-mm-ss | ||
utcOffset: "+09:00" # 한국 시간 고려 | ||
|
||
# 현재 시간 출력 (위에서 얻은 build 시점의 시간 보여주기) | ||
- name: Show Current Time | ||
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}" | ||
shell: bash | ||
# 현재 시간 출력 (위에서 얻은 build 시점의 시간 보여주기) | ||
- name: Show Current Time | ||
run: echo "CurrentTime=${{steps.current-time.outputs.formattedTime}}" | ||
shell: bash | ||
|
||
# Beanstalk 배포 | ||
- name: Beanstalk Deploy | ||
uses: einaregilsson/beanstalk-deploy@v21 | ||
with: | ||
aws_access_key: ${{secrets.AWS_ACTION_ACCESS_KEY_ID}} | ||
aws_secret_key: ${{secrets.AWS_ACTION_SECRET_ACCESS_KEY}} | ||
application_name: teammate-dev | ||
environment_name: Teammate-dev-env | ||
version_label: github-action-${{ steps.current-time.outputs.formattedTime }} # version_label은 이전에 배포한 label과 중복되면 안됨! | ||
use_existing_version_if_available: true | ||
region: ap-northeast-2 | ||
deployment_package: dist/deploy.zip | ||
wait_for_deployment: false # 바로 Beanstalk으로 넘어갈 수 있도록 함 | ||
# Beanstalk 배포 | ||
- name: Beanstalk Deploy | ||
uses: einaregilsson/beanstalk-deploy@v21 | ||
with: | ||
aws_access_key: ${{secrets.AWS_ACTION_ACCESS_KEY_ID}} | ||
aws_secret_key: ${{secrets.AWS_ACTION_SECRET_ACCESS_KEY}} | ||
application_name: teammate-dev | ||
environment_name: Teammate-dev-env | ||
version_label: github-action-${{ steps.current-time.outputs.formattedTime }} # version_label은 이전에 배포한 label과 중복되면 안됨! | ||
use_existing_version_if_available: true | ||
region: ap-northeast-2 | ||
deployment_package: dist/deploy.zip | ||
wait_for_deployment: false # 바로 Beanstalk으로 넘어갈 수 있도록 함 | ||
|
||
# 그냥 다 했다고 출력하기 | ||
- name: Deployed! | ||
run: echo App deployed to ELB | ||
# 그냥 다 했다고 출력하기 | ||
- name: Deployed! | ||
run: echo App deployed to ELB |
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
web: npm ci & npm run start | ||
# web: npm ci & npm run start | ||
web: npm ci && npm run start |
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 |
---|---|---|
@@ -1,47 +1,47 @@ | ||
{ | ||
"name": "teammate-backend", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "app.ts", | ||
"scripts": { | ||
"start": "node main.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start:dev": "nodemon --exec ts-node src/app.ts", | ||
"start:dist": "webpack --mode production & node ./dist/main.js", | ||
"build": "webpack --mode production" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.3.1", | ||
"express": "^4.18.2", | ||
"express-async-handler": "^1.2.0", | ||
"http-status-codes": "^2.3.0", | ||
"jsonwebtoken": "^9.0.2", | ||
"mysql2": "^3.7.0", | ||
"redaxios": "^0.5.1", | ||
"sequelize": "^6.35.2", | ||
"sequelize-cli": "^6.6.2", | ||
"ts-loader": "^9.5.1", | ||
"uuid": "^9.0.1", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/jsonwebtoken": "^9.0.5", | ||
"@types/node": "^20.11.0", | ||
"@typescript-eslint/eslint-plugin": "^6.18.1", | ||
"@typescript-eslint/parser": "^6.18.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"nodemon": "^3.0.2", | ||
"prettier": "^3.1.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.3.3", | ||
"webpack": "^5.90.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-node-externals": "^3.0.0" | ||
} | ||
"name": "teammate-backend", | ||
"version": "0.0.1", | ||
"description": "", | ||
"main": "app.ts", | ||
"scripts": { | ||
"start": "node dist/main.js", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"start:dev": "nodemon --exec ts-node src/app.ts", | ||
"start:dist": "webpack --mode production & node ./dist/main.js", | ||
"build": "webpack --mode production" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.3.1", | ||
"express": "^4.18.2", | ||
"express-async-handler": "^1.2.0", | ||
"http-status-codes": "^2.3.0", | ||
"jsonwebtoken": "^9.0.2", | ||
"mysql2": "^3.7.0", | ||
"redaxios": "^0.5.1", | ||
"sequelize": "^6.35.2", | ||
"sequelize-cli": "^6.6.2", | ||
"ts-loader": "^9.5.1", | ||
"uuid": "^9.0.1", | ||
"zod": "^3.22.4" | ||
}, | ||
"devDependencies": { | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/jsonwebtoken": "^9.0.5", | ||
"@types/node": "^20.11.0", | ||
"@typescript-eslint/eslint-plugin": "^6.18.1", | ||
"@typescript-eslint/parser": "^6.18.1", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"nodemon": "^3.0.2", | ||
"prettier": "^3.1.1", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.3.3", | ||
"webpack": "^5.90.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-node-externals": "^3.0.0" | ||
} | ||
} |
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
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
Oops, something went wrong.