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 +- 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