added deploy workflow #8
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: Deploy Vite App to GitHub Pages | |
| on: | |
| push: | |
| branches: | |
| - main # Deploy when pushing to master | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # ✅ Step 1: Checkout Repository | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| # ✅ Step 2: Setup Node.js | |
| - name: Set Up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 # Use the latest LTS version | |
| cache: npm # Cache dependencies for faster builds | |
| # ✅ Step 3: Install Dependencies | |
| - name: Install Dependencies | |
| run: | | |
| cd wishes_page | |
| npm install | |
| # ✅ Step 4: Build the Vite App | |
| - name: Build Vite Project | |
| run: | | |
| cd wishes_page | |
| npm run build | |
| # ✅ Step 5: Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4 | |
| with: | |
| branch: gh-pages # Deploy to 'gh-pages' branch | |
| folder: wishes_page/dist # Deploy the built files from 'dist' |