Update deploy.yml #7
This file contains 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 to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-and-deploy: | |
runs-on: windows-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 # Use a stable Node.js version | |
cache: 'npm' | |
# Step 3: Install dependencies and build the project | |
- name: Install dependencies and build | |
run: | | |
if exist dist rd /s /q dist # Clean the old dist folder on Windows | |
npm install | |
npm run build | |
# Step 4: Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: dist |