-
Notifications
You must be signed in to change notification settings - Fork 1
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 #137 from Clubber2024/dev
서버 배포 분리 작업 운영 클라이언트 환경 적용
- Loading branch information
Showing
25 changed files
with
1,076 additions
and
601 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,44 @@ | ||
# name: CI-CD dev | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - dev | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
|
||
# strategy: | ||
# matrix: | ||
# node-version: [16.16.0] | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
|
||
# - name: Set environment variables for staging | ||
# if: github.ref == 'refs/heads/dev' | ||
# run: echo "${{ secrets.STAGING_ENV }}" > .env | ||
|
||
# - name: docker build and push | ||
# run: | | ||
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
# docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-dev . | ||
# docker push ${{ secrets.DOCKER_REPO }}/clubber-front-dev | ||
|
||
# - name: executing remote ssh commands using password | ||
# uses: appleboy/ssh-action@master | ||
# with: | ||
# host: ${{ secrets.SSH_HOST }} | ||
# username: ${{ secrets.SSH_USERNAME }} | ||
# key: ${{ secrets.SSH_KEY }} | ||
# port: ${{ secrets.SSH_PORT }} | ||
# script: | | ||
# sudo docker rm -f $(docker ps -qa) | ||
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-dev | ||
# docker-compose up -d | ||
# docker image prune -f |
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,43 @@ | ||
# name: CI-CD prod | ||
|
||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
# jobs: | ||
# build: | ||
# runs-on: ubuntu-latest | ||
|
||
# strategy: | ||
# matrix: | ||
# node-version: [16.16.0] | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Use Node.js ${{ matrix.node-version }} | ||
# uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: ${{ matrix.node-version }} | ||
|
||
# - name: Set environment variables for production | ||
# run: echo "${{ secrets.PRODUCTION_ENV }}" > .env | ||
|
||
# - name: Docker build and push | ||
# run: | | ||
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
# docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front . | ||
# docker push ${{ secrets.DOCKER_REPO }}/clubber-front | ||
|
||
# - name: Executing remote SSH commands | ||
# uses: appleboy/ssh-action@master | ||
# with: | ||
# host: ${{ secrets.SSH_HOST_PROD }} | ||
# username: ${{ secrets.SSH_USERNAME }} | ||
# key: ${{ secrets.SSH_KEY_PROD }} | ||
# port: ${{ secrets.SSH_PORT }} | ||
# script: | | ||
# sudo docker rm -f $(docker ps -qa) | ||
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front | ||
# docker-compose up -d | ||
# docker image prune -f |
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,71 @@ | ||
name: CI-CD | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [16.16.0] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Set environment variables for staging | ||
if: contains(github.ref, 'dev') | ||
run: echo "${{ secrets.STAGING_ENV }}" > .env | ||
|
||
- name: Set environment variables for prod | ||
if: contains(github.ref, 'main') | ||
run: echo "${{ secrets.PRODUCTION_ENV }}" > .env | ||
|
||
- name: Docker build and push to dev | ||
if: contains(github.ref, 'dev') | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-dev . | ||
docker push ${{ secrets.DOCKER_REPO }}/clubber-front-dev | ||
- name: Docker build and push to prod | ||
if: contains(github.ref, 'main') | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKER_REPO }}/clubber-front-prod . | ||
docker push ${{ secrets.DOCKER_REPO }}/clubber-front-prod | ||
- name: Deploy to dev | ||
if: contains(github.ref, 'dev') | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
sudo docker rm -f $(docker ps -qa) | ||
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-dev | ||
sudo docker-compose -f docker-compose-dev.yml up -d | ||
docker image prune -f | ||
- name: Deploy to prod | ||
if: contains(github.ref, 'main') | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.SSH_HOST_PROD }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY_PROD }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script: | | ||
sudo docker rm -f $(docker ps -qa) | ||
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front-prod | ||
sudo docker-compose -f docker-compose-prod.yml up -d | ||
docker image prune -f |
This file was deleted.
Oops, something went wrong.
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.