From 999df796b4a841759f64227b1427d61f3dbdc56e Mon Sep 17 00:00:00 2001 From: Mooooooo Date: Sun, 3 Mar 2024 23:22:42 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20front=20CD=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/conceptbe-fe-cd.yml | 44 +++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/conceptbe-fe-cd.yml diff --git a/.github/workflows/conceptbe-fe-cd.yml b/.github/workflows/conceptbe-fe-cd.yml new file mode 100644 index 00000000..b8abe268 --- /dev/null +++ b/.github/workflows/conceptbe-fe-cd.yml @@ -0,0 +1,44 @@ +name: conceptbe-fe-cd + +on: + pull_request: + branches: [develop] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout source code. + uses: actions/checkout@v3 + + - name: Install dependencies + run: npm install + + - name: Generate build + run: npm run build + + - name: Docker Image Build + run: docker build -t pjhg410/conceptbe-fe . + + - name: Docker Hub Login + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker Hub push + run: docker push pjhg410/conceptbe-fe + + - name: Docker Pull And run + uses: appleboy/ssh-action@v0.1.6 + with: + host: ${{ secrets.WAS_HOST }} + username: ${{ secrets.WAS_USERNAME }} + password: ${{ secrets.WAS_PASSWORD }} + port: ${{ secrets.WAS_SSH_PORT }} + script: | + docker stop frontend + docker rm frontend + docker pull pjhg410/conceptbe-fe + docker run -d -p 3000:3000 --name frontend pjhg410/conceptbe-fe