diff --git a/superpowers/.github/workflows/deploy.yml b/superpowers/.github/workflows/deploy.yml new file mode 100644 index 0000000..e433649 --- /dev/null +++ b/superpowers/.github/workflows/deploy.yml @@ -0,0 +1,46 @@ +name: Deploy to GitHub Pages + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - run: npm ci + + - run: npm test + + - run: npm run build + + - uses: actions/upload-pages-artifact@v3 + with: + path: dist + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/superpowers/vite.config.ts b/superpowers/vite.config.ts index f9cbfb0..c8abcee 100644 --- a/superpowers/vite.config.ts +++ b/superpowers/vite.config.ts @@ -3,6 +3,7 @@ import { defineConfig } from "vite"; import react from "@vitejs/plugin-react"; export default defineConfig({ + base: "/try-superpowers/", plugins: [react()], test: { globals: true,