feat: added vite build #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Pages Deployment | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: production | |
env: | |
VITE_TAG_MANAGER_ID: ${{ vars.TAG_MANAGER_ID }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Get latest commit hash | |
run: | | |
COMMIT_HASH=$(git rev-parse --short HEAD) | |
echo "VITE_COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm install | |
- name: Build project with Vite | |
run: npm run build | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 |