From 7c57caf36882eea05414e43c4f933f0810c98106 Mon Sep 17 00:00:00 2001 From: minjungw00 Date: Fri, 8 Nov 2024 03:16:22 +0900 Subject: [PATCH] =?UTF-8?q?build:=20=EC=9E=90=EB=8F=99=20=EB=B0=B0?= =?UTF-8?q?=ED=8F=AC=EC=9A=A9=20github=20actions=20workflow=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #006 --- .github/workflows/deploy.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..3e829ab0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -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