Skip to content

Commit 7c83c32

Browse files
committed
ci: Add GitHub Pages deployment workflow and configure base path
- Add GitHub Actions workflow for automatic deployment to GitHub Pages - Configure Vite base path for proper GitHub Pages routing - Set up automated build and deployment on main branch pushes - Enable concurrent deployment protection and proper permissions
1 parent 0abe8e9 commit 7c83c32

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build application
27+
run: npm run build
28+
29+
- name: Setup Pages
30+
if: github.ref == 'refs/heads/main'
31+
uses: actions/configure-pages@v4
32+
33+
- name: Upload artifact
34+
if: github.ref == 'refs/heads/main'
35+
uses: actions/upload-pages-artifact@v3
36+
with:
37+
path: './dist'
38+
39+
- name: Deploy to GitHub Pages
40+
if: github.ref == 'refs/heads/main'
41+
id: deployment
42+
uses: actions/deploy-pages@v4
43+
44+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
45+
permissions:
46+
contents: read
47+
pages: write
48+
id-token: write
49+
50+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
51+
concurrency:
52+
group: "pages"
53+
cancel-in-progress: false

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import react from '@vitejs/plugin-react'
33

44
// https://vite.dev/config/
55
export default defineConfig({
6+
base: '/prolog-logic-puzzle-solver/',
67
plugins: [react()],
78
define: {
89
global: 'globalThis',

0 commit comments

Comments
 (0)