Skip to content

Commit 0f94fb4

Browse files
Fix GitHub Pages deployment configuration
- Set correct base path for GitHub Pages in vite.config.js - Add .nojekyll file to prevent Jekyll processing - Update GitHub Actions workflow for proper Pages deployment - Add required permissions and environment settings
1 parent 2f9cfef commit 0f94fb4

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,20 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
918
jobs:
1019
build-and-deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
1123
runs-on: ubuntu-latest
1224

1325
steps:
@@ -26,9 +38,14 @@ jobs:
2638
- name: Build
2739
run: npm run build
2840

29-
- name: Deploy to GitHub Pages
30-
uses: peaceiris/actions-gh-pages@v3
31-
if: github.ref == 'refs/heads/main'
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v3
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v2
3246
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./dist
47+
path: ./dist
48+
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v2

deploy-log.txt

96 Bytes
Binary file not shown.

public/.nojekyll

Whitespace-only changes.

vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
44
// https://vite.dev/config/
55
export default defineConfig({
66
plugins: [react()],
7+
base: '/js-learning-lab/',
78
})

0 commit comments

Comments
 (0)