Skip to content

Commit

Permalink
fix: backend-cd.yml
Browse files Browse the repository at this point in the history
이벤트 트리거:
on: 아래에 push 이벤트는 develop 브랜치에, 그리고 pull_request 이벤트는 main과 develop 브랜치에 대해 트리거되도록 수정

기본 작업 디렉토리:
jobs.deploy.defaults.run.working-directory를 backend로 지정해 모든 run 단계가 backend 디렉토리에서 실행되도록 수정
  • Loading branch information
dlwldnjs1009 authored Mar 1, 2025
1 parent 70ba9d9 commit 7715a48
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/backend-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ name: 배포

on:
push:
branches: [ "develop" ]
branches:
- 'be/**'
pull_request:
branches:
- main
- develop

jobs:
deploy:
runs-on: ubuntu-latest # 작업이 실행될 환경
defaults:
run:
working-directory: backend
steps:
- name: 체크아웃
uses: actions/checkout@v3
Expand Down Expand Up @@ -36,5 +44,7 @@ jobs:
username: ubuntu
key: ${{ secrets.AWS_KEY }}
script: |
sudo docker rm -f $(docker ps -qa)
docker pull ${{ secrets.DOCKER_USER_NAME }}/${{ secrets.DOCKER_IMAGE_NAME }}-be:latest
docker-compose --env-file .env.production up -d
docker-compose --env-file .env.production up -d
docker image prune -f

0 comments on commit 7715a48

Please sign in to comment.