Skip to content

Commit 7545381

Browse files
authored
Merge pull request #2 from foridpathan/development
demo deployment Add
2 parents 7b9ab37 + 47ccb58 commit 7545381

6 files changed

Lines changed: 302 additions & 28 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v3
19+
20+
- name: Install dependencies
21+
run: npm install --no-package-lock
22+
23+
- name: Build project
24+
run: npm run build
25+
26+
- name: Upload production-ready build files
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: production-files
30+
path: ./build
31+
32+
deploy:
33+
name: Deploy
34+
needs: build
35+
runs-on: ubuntu-latest
36+
if: github.ref == 'refs/heads/main'
37+
38+
steps:
39+
- name: Download artifact
40+
uses: actions/download-artifact@v3
41+
with:
42+
name: production-files
43+
path: ./build
44+
45+
- name: Deploy to GitHub Pages
46+
uses: peaceiris/actions-gh-pages@v3
47+
with:
48+
github_token: ${{ secrets.GITHUB_TOKEN }}
49+
publish_dir: ./build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lerna-debug.log*
99

1010
node_modules
1111
dist
12+
build
1213
dist-ssr
1314
*.local
1415

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"dev": "vite",
88
"start": "npm run dev -- --port 3000 --host",
99
"build": "tsc && vite build",
10-
"deploy": "gh-pages -d demo",
10+
"lib": "tsc && vite build --config vite.config.lib.ts",
11+
"predeploy": "npm run build",
12+
"deploy": "gh-pages -d build",
1113
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1214
"preview": "vite preview",
1315
"test": "vitest"
@@ -36,6 +38,7 @@
3638
"eslint": "^9.17.0",
3739
"eslint-plugin-react-hooks": "^5.0.0",
3840
"eslint-plugin-react-refresh": "^0.4.16",
41+
"gh-pages": "^6.3.0",
3942
"globals": "^15.14.0",
4043
"postcss": "^8.5.1",
4144
"react": "^18.3.1",

0 commit comments

Comments
 (0)