-
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 branch 'dev' of https://github.com/Clubber2024/Clubber-Server i…
…nto dev # Conflicts: # .github/workflows/ci-cd-prod.yml # docker-compose.yml
- Loading branch information
Showing
8 changed files
with
488 additions
and
193 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,88 +1,88 @@ | ||
name: CI-CD Dev | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
CI-CD: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
- name: make application.yml | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application.yml | ||
echo "${{ secrets.YML }}" > ./application.yml | ||
shell: bash | ||
|
||
- name: make application-dev.yml | ||
run: | | ||
cd ./src/main/resources | ||
touch ./application-dev.yml | ||
echo "${{ secrets.YML_DEV }}" > ./application-dev.yml | ||
shell: bash | ||
|
||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew clean build -x test | ||
|
||
- name: docker build and push | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKER_REPO }}/clubber-backend . | ||
docker push ${{ secrets.DOCKER_REPO }}/clubber-backend | ||
- name: Copy docker-compose.yml to EC2 | ||
uses: appleboy/scp-action@master | ||
with: | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ubuntu | ||
key: ${{ secrets.PRIVATE_KEY_DEV }} | ||
source: ./docker-compose.yml | ||
target: /home/ubuntu | ||
|
||
|
||
- name: Deploy to dev | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ubuntu | ||
key: ${{ secrets.PRIVATE_KEY_DEV }} | ||
script: | | ||
cd /home/ubuntu | ||
sudo docker rm -f $(docker ps -qa) | ||
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-backend | ||
sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front | ||
sudo docker-compose up -d | ||
sudo docker image prune -f | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
#name: CI-CD Dev | ||
# | ||
#on: | ||
# push: | ||
# branches: | ||
# - dev | ||
# | ||
#jobs: | ||
# CI-CD: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# | ||
# - name: make application.yml | ||
# run: | | ||
# cd ./src/main/resources | ||
# touch ./application.yml | ||
# echo "${{ secrets.YML }}" > ./application.yml | ||
# shell: bash | ||
# | ||
# - name: make application-dev.yml | ||
# run: | | ||
# cd ./src/main/resources | ||
# touch ./application-dev.yml | ||
# echo "${{ secrets.YML_DEV }}" > ./application-dev.yml | ||
# shell: bash | ||
# | ||
# - name: Gradle Caching | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
# | ||
# - name: Grant execute permission for gradlew | ||
# run: chmod +x gradlew | ||
# | ||
# - name: Build with Gradle | ||
# run: ./gradlew clean build -x test | ||
# | ||
# - name: docker build and push | ||
# run: | | ||
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
# docker build -t ${{ secrets.DOCKER_REPO }}/clubber-backend-dev . | ||
# docker push ${{ secrets.DOCKER_REPO }}/clubber-backend-dev | ||
# | ||
# - name: Copy docker-compose.yml to EC2 | ||
# uses: appleboy/scp-action@master | ||
# with: | ||
# host: ${{ secrets.HOST_DEV }} | ||
# username: ubuntu | ||
# key: ${{ secrets.PRIVATE_KEY_DEV }} | ||
# source: ./docker-compose.yml | ||
# target: /home/ubuntu | ||
# | ||
# | ||
# - name: Deploy to dev | ||
# uses: appleboy/ssh-action@master | ||
# with: | ||
# host: ${{ secrets.HOST_DEV }} | ||
# username: ubuntu | ||
# key: ${{ secrets.PRIVATE_KEY_DEV }} | ||
# script: | | ||
# cd /home/ubuntu | ||
# sudo docker rm -f $(docker ps -qa) | ||
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-backend-dev | ||
# sudo docker pull ${{ secrets.DOCKER_REPO }}/clubber-front | ||
# sudo docker-compose up -d | ||
# sudo 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 |
---|---|---|
@@ -1,96 +1,104 @@ | ||
#name: CI-CD Main | ||
# | ||
#on: | ||
# push: | ||
# branches: | ||
# - main | ||
# | ||
#jobs: | ||
# CI-CD: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# - name: Set up JDK 17 | ||
# uses: actions/setup-java@v3 | ||
# with: | ||
# java-version: '17' | ||
# distribution: 'temurin' | ||
# | ||
# - name: make application.yml | ||
# run: | | ||
# cd ./src/main/resources | ||
# touch ./application.yml | ||
# echo "${{ secrets.YML }}" > ./application.yml | ||
# shell: bash | ||
# | ||
# - name: make application-prod.yml | ||
# run: | | ||
# cd ./src/main/resources | ||
# touch ./application-prod.yml | ||
# echo "${{ secrets.YML_PROD }}" > ./application-prod.yml | ||
# shell: bash | ||
# | ||
# - name: Gradle Caching | ||
# uses: actions/cache@v3 | ||
# with: | ||
# path: | | ||
# ~/.gradle/caches | ||
# ~/.gradle/wrapper | ||
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-gradle- | ||
# | ||
# - name: Grant execute permission for gradlew | ||
# run: chmod +x gradlew | ||
# | ||
# - name: Build with Gradle | ||
# run: ./gradlew clean build -x test | ||
# | ||
# - name: Docker Hub Login | ||
# uses: docker/login-action@v2 | ||
# with: | ||
# username: ${{ secrets.DOCKER_USERNAME }} | ||
# password: ${{ secrets.DOCKER_PASSWORD }} | ||
# | ||
# - name: Docker build & push to prod | ||
# run: | | ||
# docker build -f Dockerfile -t ${{ secrets.DOCKER_REPO }} . | ||
# docker push ${{ secrets.DOCKER_REPO }} | ||
# | ||
# - name: Copy docker-compose.yml to EC2 | ||
# uses: appleboy/scp-action@master | ||
# with: | ||
# host: ${{ secrets.HOST_PROD }} | ||
# username: ubuntu | ||
# key: ${{ secrets.PRIVATE_KEY }} | ||
# source: ./docker-compose.yml | ||
# target: /home/ubuntu | ||
# | ||
#<<<<<<< HEAD:.github/workflows/ci-cd-prod.yml | ||
##name: CI-CD Main | ||
## | ||
##on: | ||
## push: | ||
## branches: | ||
## - main | ||
## | ||
##jobs: | ||
## CI-CD: | ||
## runs-on: ubuntu-latest | ||
## steps: | ||
## - uses: actions/checkout@v3 | ||
## - name: Set up JDK 17 | ||
## uses: actions/setup-java@v3 | ||
## with: | ||
## java-version: '17' | ||
## distribution: 'temurin' | ||
## | ||
## - name: make application.yml | ||
## run: | | ||
## cd ./src/main/resources | ||
## touch ./application.yml | ||
## echo "${{ secrets.YML }}" > ./application.yml | ||
## shell: bash | ||
## | ||
## - name: make application-prod.yml | ||
## run: | | ||
## cd ./src/main/resources | ||
## touch ./application-prod.yml | ||
## echo "${{ secrets.YML_PROD }}" > ./application-prod.yml | ||
## shell: bash | ||
## | ||
## - name: Gradle Caching | ||
## uses: actions/cache@v3 | ||
## with: | ||
## path: | | ||
## ~/.gradle/caches | ||
## ~/.gradle/wrapper | ||
## key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
## restore-keys: | | ||
## ${{ runner.os }}-gradle- | ||
## | ||
## - name: Grant execute permission for gradlew | ||
## run: chmod +x gradlew | ||
## | ||
## - name: Build with Gradle | ||
## run: ./gradlew clean build -x test | ||
## | ||
## - name: Docker Hub Login | ||
## uses: docker/login-action@v2 | ||
## with: | ||
## username: ${{ secrets.DOCKER_USERNAME }} | ||
## password: ${{ secrets.DOCKER_PASSWORD }} | ||
## | ||
## - name: Docker build & push to prod | ||
## run: | | ||
## docker build -f Dockerfile -t ${{ secrets.DOCKER_REPO }} . | ||
## docker push ${{ secrets.DOCKER_REPO }} | ||
## | ||
## - name: Copy docker-compose.yml to EC2 | ||
## uses: appleboy/scp-action@master | ||
## with: | ||
## host: ${{ secrets.HOST_PROD }} | ||
## username: ubuntu | ||
## key: ${{ secrets.PRIVATE_KEY }} | ||
## source: ./docker-compose.yml | ||
## target: /home/ubuntu | ||
## | ||
#<<<<<<< HEAD | ||
##<<<<<<< HEAD:.github/workflows/ci-cd-prod.yml | ||
##======= | ||
## | ||
##>>>>>>> ab12d3e1dc94b1b0b11fe199be0ceac1ac41aea5:.github/workflows/ci-main.yml | ||
#======= | ||
# | ||
#>>>>>>> ab12d3e1dc94b1b0b11fe199be0ceac1ac41aea5:.github/workflows/ci-main.yml | ||
# - name: Deploy to prod | ||
# uses: appleboy/ssh-action@master | ||
# with: | ||
# host: ${{ secrets.HOST_PROD }} | ||
# username: ubuntu | ||
# key: ${{ secrets.PRIVATE_KEY }} | ||
# script: | | ||
# cd /home/ubuntu | ||
# sudo docker rm -f $(docker ps -qa) | ||
# sudo docker pull ${{ secrets.DOCKER_REPO }} | ||
# sudo docker pull mjkim1229/clubber-client | ||
# sudo docker-compose up -d | ||
# sudo docker image prune -f | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
# | ||
#>>>>>>> d1f3539ec5df7a6051010d084d30c2198cfbe2dd | ||
## - name: Deploy to prod | ||
## uses: appleboy/ssh-action@master | ||
## with: | ||
## host: ${{ secrets.HOST_PROD }} | ||
## username: ubuntu | ||
## key: ${{ secrets.PRIVATE_KEY }} | ||
## script: | | ||
## cd /home/ubuntu | ||
#<<<<<<< HEAD | ||
## sudo docker rm -f $(docker ps -qa) | ||
## sudo docker pull ${{ secrets.DOCKER_REPO }} | ||
## sudo docker pull mjkim1229/clubber-client | ||
#======= | ||
## sudo docker-compose down | ||
## sudo docker-compose pull ${{ secrets.DOCKER_REPO }} | ||
#>>>>>>> d1f3539ec5df7a6051010d084d30c2198cfbe2dd | ||
## sudo docker-compose up -d | ||
## sudo docker image prune -f | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## | ||
## |
Oops, something went wrong.