From d1c4ae889a4f7ff3f8a208b16a3cf30b2f436530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=AC=B8=EC=A7=80=EC=9B=90?= <81554184+jeewonMoon@users.noreply.github.com> Date: Tue, 9 Jul 2024 00:19:07 +0900 Subject: [PATCH 1/2] Create pull_request_template.md --- .github/pull_request_template.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..029061a --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,4 @@ +## Issue +- #이슈번호 +## Details +- From 7192c61e613b81764d083f55a7aae98250586ad5 Mon Sep 17 00:00:00 2001 From: anhye0n Date: Wed, 10 Jul 2024 10:58:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20ci/cd=20=EC=8A=A4=ED=81=AC=EB=A6=BD?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflow/deploy.yml | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflow/deploy.yml diff --git a/.github/workflow/deploy.yml b/.github/workflow/deploy.yml new file mode 100644 index 0000000..f111c32 --- /dev/null +++ b/.github/workflow/deploy.yml @@ -0,0 +1,48 @@ +name: CI/CD Pipeline + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: Install dependencies + run: npm install + + - name: Build project + run: npm run build + + - name: Prepare deployment package + run: | + mkdir -p build/deployment + cp -r dist/* build/deployment/ + + - name: Deploy to Home Server + uses: appleboy/scp-action@v0.0.1 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "build/deployment/*" + target: "/home/anhye0n/web/tutorial_sejong/frontend/dist" + + - name: Restart Nginx + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + script: | + sudo systemctl restart nginx