Skip to content

Commit 3e2a126

Browse files
authored
Merge pull request #20 from GYFX35/feat/add-gh-pages-deployment
feat: Add GitHub Pages deployment workflow
2 parents 105189f + 7c33d0e commit 3e2a126

4 files changed

Lines changed: 33 additions & 169 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: '18'
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- name: Build
24+
run: npm run build
25+
26+
- name: Deploy
27+
uses: peaceiris/actions-gh-pages@v3
28+
with:
29+
github_token: ${{ secrets.GITHUB_TOKEN }}
30+
publish_dir: ./dist

package-lock.json

Lines changed: 0 additions & 168 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "codespaces-react",
3+
"homepage": "https://GYFX35.github.io/codespaces-react",
34
"version": "0.1.0",
45
"private": true,
56
"dependencies": {
@@ -19,7 +20,7 @@
1920
"start": "BROWSER=none WDS_SOCKET_PORT=0 vite --port 3000",
2021
"build": "vite build",
2122
"preview": "vite preview",
22-
"test": "vitest"
23+
"test": "vitest run"
2324
},
2425
"eslintConfig": {
2526
"extends": [

vite.config.js

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://vitejs.dev/config/
55
export default defineConfig({
6+
base: "/codespaces-react/",
67
plugins: [react()],
78
test: {
89
globals: true,

0 commit comments

Comments
 (0)