Skip to content

Commit 380d3aa

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

15 files changed

+1629
-83
lines changed

Diff for: .github/workflows/deploy.yml

+17-7
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,37 @@ 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

22-
- name: Get latest commit hash
25+
- name: Set environment variables
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
29+
echo "VITE_HOST=$(cat CNAME)" >> $GITHUB_ENV
2630
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
31+
- name: Set up Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: 20
35+
36+
- name: Install dependencies
37+
run: npm install
38+
39+
- name: Build project with Vite
40+
run: npm run build
3141

3242
- name: Setup Pages
3343
uses: actions/configure-pages@v4
3444

3545
- name: Upload artifact
3646
uses: actions/upload-pages-artifact@v3
3747
with:
38-
path: .
48+
path: ./dist
3949

4050
- name: Deploy to GitHub Pages
4151
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)