-
Notifications
You must be signed in to change notification settings - Fork 4
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 #76 from boostcampwm-2024/Feature/#006_배포_자동화_구축
Feature/#006_배포_자동화_구축
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Deploy on Server | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: [self-hosted, boost-was] # 라벨에 해당하는 runner로 실행 | ||
|
||
steps: | ||
# 1. 레포지토리 클론 | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
# 2. Docker Compose로 서비스 빌드 및 재시작 | ||
- name: Set up Docker | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Build and Deploy Docker Images | ||
run: | | ||
# docker-compose로 배포 | ||
docker-compose up -d --build | ||
# 3. Clean up Old Images | ||
- name: Remove Dangling Images | ||
run: docker image prune -f |