Skip to content

Commit 1b117b7

Browse files
committed
feat: added vite build
1 parent a7e68cc commit 1b117b7

15 files changed

+1619
-75
lines changed

Diff for: .github/workflows/deploy.yml

+15-6
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,36 @@ jobs:
1515
runs-on: ubuntu-latest
1616
environment: production
1717

18+
env:
19+
VITE_TAG_MANAGER_ID: ${{ vars.TAG_MANAGER_ID }}
20+
1821
steps:
1922
- name: Checkout repo
2023
uses: actions/checkout@v4
2124

2225
- name: Get latest commit hash
2326
run: |
2427
COMMIT_HASH=$(git rev-parse --short HEAD)
25-
echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV
28+
echo "VITE_COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV
2629
27-
- name: Inject placeholder tokens
28-
run: |
29-
sed -i "s|{{COMMIT_HASH}}|${{ env.COMMIT_HASH }}|g" index.html
30-
sed -i "s|{{TAG_MANAGER_ID}}|${{ vars.TAG_MANAGER_ID }}|g" index.html
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: 20
34+
35+
- name: Install dependencies
36+
run: npm install
37+
38+
- name: Build project with Vite
39+
run: npm run build
3140

3241
- name: Setup Pages
3342
uses: actions/configure-pages@v4
3443

3544
- name: Upload artifact
3645
uses: actions/upload-pages-artifact@v3
3746
with:
38-
path: .
47+
path: ./dist
3948

4049
- name: Deploy to GitHub Pages
4150
uses: actions/deploy-pages@v4

Diff for: .gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
# Node
3+
node_modules/*
4+
5+
# Static assets
6+
dist/*
7+
8+
# VSCode
9+
.vscode/*
10+
!.vscode/settings.json
11+
!.vscode/tasks.json
12+
!.vscode/launch.json
13+
!.vscode/extensions.json
14+
!.vscode/*.code-snippets
15+
16+
# Local History for Visual Studio Code
17+
.history/
18+
19+
# Built Visual Studio Code Extensions
20+
*.vsix
21+
22+
# Mac/OSX
23+
.DS_Store
24+

0 commit comments

Comments
 (0)