-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #540 from Scents-Note/main
Merge Main to Production-1
- Loading branch information
Showing
155 changed files
with
6,051 additions
and
6,377 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Deploy production-1 server to ec2 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- production-1 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Deploy to EC2 using SSH | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cp ~/config-injection/ecosystem-${{ env.SERVER_PROFILE }}.json ${{ env.PROJECT_PATH }}/ecosystem.json && | ||
cp ~/config-injection/envs/.env.${{ env.NODE_ENV }} ${{ env.PROJECT_PATH }}/.env && | ||
cd ${{ env.PROJECT_PATH }} && | ||
git fetch --all && | ||
git checkout ${{ env.BRANCH_NAME }} && | ||
git pull origin ${{ env.BRANCH_NAME }} && | ||
bash script/prebuild.sh && | ||
bash script/reload.sh | ||
env: | ||
BRANCH_NAME: production-1 | ||
NODE_ENV: production | ||
SERVER_PROFILE: production-1 | ||
PROJECT_PATH: ~/actions-runner/_work/A.fume.Server/A.fume.Server/production-1 |
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,47 @@ | ||
name: Deploy production-2 server to ec2 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- production-2 | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Deploy to EC2 using SSH | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cp ~/config-injection/ecosystem-${{ env.SERVER_PROFILE }}.json ${{ env.PROJECT_PATH }}/ecosystem.json && | ||
cp ~/config-injection/envs/.env.${{ env.NODE_ENV }} ${{ env.PROJECT_PATH }}/.env && | ||
cd ${{ env.PROJECT_PATH }} && | ||
git fetch --all && | ||
git checkout ${{ env.BRANCH_NAME }} && | ||
git pull origin ${{ env.BRANCH_NAME }} && | ||
bash script/prebuild.sh && | ||
bash script/reload.sh | ||
env: | ||
BRANCH_NAME: production-2 | ||
NODE_ENV: production | ||
SERVER_PROFILE: production-2 | ||
PROJECT_PATH: ~/actions-runner/_work/A.fume.Server/A.fume.Server/production-2 |
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,36 +1,47 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: Deploy production server to ec2 | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: self-hosted | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
defaults: | ||
run: | ||
working-directory: ${{ env.SERVER_PROFILE }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
path: ${{ env.SERVER_PROFILE }} | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: cp ~/config-injection/ecosystem-${{ env.SERVER_PROFILE }}.json ${{ env.PROJECT_PATH }}/ecosystem.json | ||
- run: cp ~/config-injection/envs/.env.${{ env.NODE_ENV }} ${{ env.PROJECT_PATH }}/.env | ||
- run: bash ${{ env.PROJECT_PATH }}/script/prebuild.sh | ||
- run: sh ${{ env.PROJECT_PATH }}/script/reload.sh | ||
|
||
- name: Deploy to EC2 using SSH | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cp ~/config-injection/ecosystem-${{ env.SERVER_PROFILE }}.json ${{ env.PROJECT_PATH }}/ecosystem.json && | ||
cp ~/config-injection/envs/.env.${{ env.NODE_ENV }} ${{ env.PROJECT_PATH }}/.env && | ||
cd ${{ env.PROJECT_PATH }} && | ||
git fetch --all && | ||
git checkout ${{ env.BRANCH_NAME }} && | ||
git pull origin ${{ env.BRANCH_NAME }} && | ||
bash script/prebuild.sh && | ||
bash script/reload.sh | ||
env: | ||
BRANCH_NAME: main | ||
NODE_ENV: production | ||
SERVER_PROFILE: production | ||
PROJECT_PATH: ~/actions-runner/_work/A.fume.Server/A.fume.Server/production |
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,21 @@ | ||
# 환경 | ||
|
||
- dev | ||
- 목적: 개발환경에서 사용. | ||
- 기준 브랜치: dev | ||
- production-1 | ||
- 목적: ios 용 엔드포인트 | ||
- production-2 | ||
- 목적: android 용 엔드포인트 | ||
|
||
* production 이 현재 1과 2, 2개가 공존하는 상황. 초기에 안전성을 위해 분리한 것으로 보이나, 불필요한 분리여서 합치는 것이 좋다고 판단. | ||
|
||
# 배포 | ||
|
||
- dev 환경 | ||
- dev 브랜치에 병합시 자동으로 배포됨 | ||
- production-1, production-2 | ||
- [저장소의 깃헙액션 페이지](https://github.com/Scents-Note/A.fume.Server/actions) 에서 각 환경에 해당하는 워크플로우 진입 후, 아래 과정을 따라 수행 | ||
- Run workflow 드랍다운 클릭 | ||
- 배포를 원하는 브랜치 선택 | ||
- 초록색 Run workflow 버튼 클릭 |
Oops, something went wrong.