From c0e6783088d1b7e486b1c690ea5941d5e64a907a Mon Sep 17 00:00:00 2001 From: krokerdile Date: Sat, 11 Nov 2023 09:53:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Github=20Action=20=EB=B0=B0=ED=8F=AC=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=82=B4=EC=9A=A9=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?-=20main.jsx,=20vite.config.js=20baseUrl=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 | 49 +++++++++++++++++++++++++++++++++++++ src/main.jsx | 2 +- vite.config.js | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) 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..10c5478 --- /dev/null +++ b/.github/workflow/deploy.yml @@ -0,0 +1,49 @@ +name: Deploy + +on: + push: + branches: + - main + +jobs: + build: + name: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + + - name: Install dependencies + run: yarn install + + - name: Build project + run: yarn build + + - name: Upload production-ready build files + uses: actions/upload-artifact@v3 + with: + name: production-files + path: ./dist + + deploy: + name: Deploy + needs: build + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + + steps: + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: production-files + path: ./dist + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist diff --git a/src/main.jsx b/src/main.jsx index 5ae4f71..16323fc 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -6,7 +6,7 @@ import { BrowserRouter } from "react-router-dom"; ReactDOM.createRoot(document.getElementById("root")).render( - + diff --git a/vite.config.js b/vite.config.js index 259ec51..bc4f930 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,5 +4,5 @@ import react from "@vitejs/plugin-react"; // https://vitejs.dev/config/ export default defineConfig({ plugins: [react()], - base: "/", + base: "/ContractAssistant_FE", });