From f8797a41d64cdf7145a474c9bae0937c12cce909 Mon Sep 17 00:00:00 2001 From: Jacky Sun Date: Sat, 18 May 2024 18:21:06 -0700 Subject: [PATCH] set up github actions for deployment --- .github/workflows/deploy.yml | 31 +++++++++++++++++++++++++++++++ vite.config.js | 1 + 2 files changed, 32 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 0000000..5bee0f4 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: + - main # or the branch you want to trigger the deployment + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '22' # Specify the Node.js version you want to use + + - name: Install dependencies + run: npm install + + - name: Build the project + run: npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./dist diff --git a/vite.config.js b/vite.config.js index ce24c95..1994094 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react' // https://vitejs.dev/config/ export default defineConfig({ + base: '/nala-auto/', plugins: [react()], server: { proxy: {