diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..1e6b42a --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,51 @@ +name: Deploy to GitHub Pages + +on: + release: + types: [published] + workflow_dispatch: # Allows manual trigger + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout + uses: actions/checkout@v4 + + - name: � Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: 📦 Install dependencies + run: bun install --frozen-lockfile + + - name: 🔨 Build + run: bun run build + + - name: 📤 Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: 🚀 Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..845a35b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint Check + +on: + pull_request: + branches: [main] + push: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: 📥 Checkout + uses: actions/checkout@v4 + + - name: 🟣 Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: 📦 Install dependencies + run: bun install --frozen-lockfile + + - name: 🔍 Run Biome lint + run: bun run lint diff --git a/vite.config.ts b/vite.config.ts index b92bd63..e5313ae 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "vite"; // https://vite.dev/config/ export default defineConfig({ + base: process.env.GITHUB_ACTIONS ? "/race-timer/" : "/", plugins: [ react({ babel: {