Update README.md #5
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
# .github/workflows/deploy.yml | |
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ master ] # Change to 'master' if needed | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
build-and-deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build with Vite | |
run: npm run build | |
# Ensure your package.json has: "build": "vite build" | |
- name: Setup GitHub Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact to Pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist # Vite default output directory | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |