Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SeungGwan123 committed Nov 27, 2024
1 parent fb7168a commit d1423d8
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 113 deletions.
216 changes: 108 additions & 108 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ jobs:
- server: main
host: ${{ vars.SSH_HOST }}
type: full
- server: loadbalancer
host: ${{ vars.LOAD_SSH_HOST }}
type: api
- server: loadbalancer2
host: ${{ vars.LOAD_SSH_HOST_2 }}
type: api2
- server: loadbalancer3
host: ${{ vars.LOAD_SSH_HOST_3 }}
type: api3
- server: loadbalancer4
host: ${{ vars.LOAD_SSH_HOST_4 }}
type: api4
# - server: loadbalancer
# host: ${{ vars.LOAD_SSH_HOST }}
# type: api
# - server: loadbalancer2
# host: ${{ vars.LOAD_SSH_HOST_2 }}
# type: api2
# - server: loadbalancer3
# host: ${{ vars.LOAD_SSH_HOST_3 }}
# type: api3
# - server: loadbalancer4
# host: ${{ vars.LOAD_SSH_HOST_4 }}
# type: api4
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -69,53 +69,53 @@ jobs:
target: /corinee
overwrite: true

- name: Send files to loadbalancer
if: matrix.type == 'api'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
source: "docker-compose.server.yml,.env"
target: /corinee
overwrite: true
# - name: Send files to loadbalancer
# if: matrix.type == 'api'
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD }}
# port: ${{ secrets.SSH_PORT }}
# source: "docker-compose.server.yml,.env"
# target: /corinee
# overwrite: true

- name: Send files to loadbalancer
if: matrix.type == 'api2'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_2 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_2 }}
port: ${{ secrets.SSH_PORT }}
source: "docker-compose.server.yml,.env"
target: /corinee
overwrite: true
# - name: Send files to loadbalancer
# if: matrix.type == 'api2'
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_2 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_2 }}
# port: ${{ secrets.SSH_PORT }}
# source: "docker-compose.server.yml,.env"
# target: /corinee
# overwrite: true

- name: Send files to loadbalancer
if: matrix.type == 'api3'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_3 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_3 }}
port: ${{ secrets.SSH_PORT }}
source: "docker-compose.server.yml,.env"
target: /corinee
overwrite: true
# - name: Send files to loadbalancer
# if: matrix.type == 'api3'
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_3 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_3 }}
# port: ${{ secrets.SSH_PORT }}
# source: "docker-compose.server.yml,.env"
# target: /corinee
# overwrite: true

- name: Send files to loadbalancer
if: matrix.type == 'api4'
uses: appleboy/scp-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_4 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_4 }}
port: ${{ secrets.SSH_PORT }}
source: "docker-compose.server.yml,.env"
target: /corinee
overwrite: true
# - name: Send files to loadbalancer
# if: matrix.type == 'api4'
# uses: appleboy/scp-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_4 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_4 }}
# port: ${{ secrets.SSH_PORT }}
# source: "docker-compose.server.yml,.env"
# target: /corinee
# overwrite: true

- name: Deploy to main server
if: matrix.type == 'full'
Expand All @@ -132,61 +132,61 @@ jobs:
docker-compose down
docker-compose up -d
- name: Deploy to loadbalancer1
if: matrix.type == 'api'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /corinee
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
docker-compose -f docker-compose.server.yml down
docker-compose -f docker-compose.server.yml up -d
# - name: Deploy to loadbalancer1
# if: matrix.type == 'api'
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# cd /corinee
# docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
# docker-compose -f docker-compose.server.yml down
# docker-compose -f docker-compose.server.yml up -d

- name: Deploy to loadbalancer2
if: matrix.type == 'api2'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_2 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_2 }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /corinee
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
docker-compose -f docker-compose.server.yml down
docker-compose -f docker-compose.server.yml up -d
# - name: Deploy to loadbalancer2
# if: matrix.type == 'api2'
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_2 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_2 }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# cd /corinee
# docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
# docker-compose -f docker-compose.server.yml down
# docker-compose -f docker-compose.server.yml up -d

- name: Deploy to loadbalancer3
if: matrix.type == 'api3'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_3 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_3 }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /corinee
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
docker-compose -f docker-compose.server.yml down
docker-compose -f docker-compose.server.yml up -d
# - name: Deploy to loadbalancer3
# if: matrix.type == 'api3'
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_3 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_3 }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# cd /corinee
# docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
# docker-compose -f docker-compose.server.yml down
# docker-compose -f docker-compose.server.yml up -d

- name: Deploy to loadbalancer4
if: matrix.type == 'api4'
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.LOAD_SSH_HOST_4 }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.LOAD_SSH_PASSWORD_4 }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /corinee
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
docker-compose -f docker-compose.server.yml down
docker-compose -f docker-compose.server.yml up -d
# - name: Deploy to loadbalancer4
# if: matrix.type == 'api4'
# uses: appleboy/ssh-action@master
# with:
# host: ${{ secrets.LOAD_SSH_HOST_4 }}
# username: ${{ secrets.SSH_USERNAME }}
# password: ${{ secrets.LOAD_SSH_PASSWORD_4 }}
# port: ${{ secrets.SSH_PORT }}
# script: |
# cd /corinee
# docker pull ${{ secrets.DOCKERHUB_USERNAME }}/corinee-server
# docker-compose -f docker-compose.server.yml down
# docker-compose -f docker-compose.server.yml up -d

- name: Generate Error Report
if: failure()
Expand Down
10 changes: 5 additions & 5 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ http {
upstream api_servers {
least_conn;
server corinee_server_1:3000 weight=4; # 메인 서버의 API (docker network 내부 이름 사용)
server 223.130.134.167:3000 weight=8; # 두 번째 서버의 공인 IP
server 223.130.130.192:3000 weight=8;
server 211.188.59.137:3000 weight=8;
server 211.188.59.126:3000 weight=1;
server 124.28.132.80:7999 weight=70;
# server 223.130.134.167:3000 weight=8; # 두 번째 서버의 공인 IP
# server 223.130.130.192:3000 weight=8;
# server 211.188.59.137:3000 weight=8;
# server 211.188.59.126:3000 weight=1;
# server 124.28.132.80:7999 weight=80;
}

server {
Expand Down

0 comments on commit d1423d8

Please sign in to comment.