From fe86979602944c77e5f876021692d58867eef453 Mon Sep 17 00:00:00 2001 From: KartoffelChips Date: Sun, 27 Oct 2024 10:35:15 +0100 Subject: [PATCH] deploy config --- .github/workflows/deploy.yml | 58 ++++++++++++++++++++++++++++++++++++ vite.config.ts | 1 + 2 files changed, 59 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..406a73f --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,58 @@ +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 + with: + node-version: '16' + + - name: Install Bun + run: | + curl -fsSL https://bun.sh/install | bash + export BUN_INSTALL="$HOME/.bun" + export PATH="$BUN_INSTALL/bin:$PATH" + bun --version + + - name: Install dependencies + run: bun install + + - name: Build project + run: bun run 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 \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 2cb1546..bb26693 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,4 +3,5 @@ import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], + base: "/TensuraMap/" })