Skip to content

Commit

Permalink
Merge pull request #214 from EFUB4-Jukebox/deploy
Browse files Browse the repository at this point in the history
[Hotfix] docker compose 관련 배포 설정 변경
  • Loading branch information
seohyun-lee authored Aug 19, 2024
2 parents 6a0af77 + 4df9687 commit b30fcbb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI/CD using GitHub Actions & Docker

# main 브랜치에 push하면 워크플로우 실행
# main 또는 deploy 브랜치에 push하면 워크플로우 실행
on:
push:
branches: [ "main" ]
branches: [ "main", "deploy" ]

jobs:
deploy:
Expand All @@ -21,7 +21,7 @@ jobs:
cd ./src/main/resources
touch ./application.yml
echo "${{ secrets.APPLICATION_PROD }}" > ./application.yml
- name: Gradle Caching
uses: actions/cache@v3
with:
Expand All @@ -31,12 +31,12 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew build -x test
- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand All @@ -60,7 +60,7 @@ jobs:
envs: GITHUB_SHA
script: |
echo "${{ secrets.DOCKER_COMPOSE_PROD }}" | sudo tee ./docker-compose.yml
sudo docker rm -f $(sudo docker ps -aq)
sudo docker-compose -f ./docker-compose.yml down --rmi all
sudo docker ps -q | xargs -r sudo docker stop && sudo docker ps -aq | xargs -r sudo docker rm
sudo docker compose --file ./docker-compose.yml down --rmi all
sudo docker pull ${{ secrets.DOCKER_REPO }}:latest
sudo docker-compose -f ./docker-compose.yml up -d
sudo docker compose --file ./docker-compose.yml up -d

0 comments on commit b30fcbb

Please sign in to comment.