Skip to content

Deploy to GitHub Pages #1

Deploy to GitHub Pages

Deploy to GitHub Pages #1

name: Deploy to GitHub Pages
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Node.js environment
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
# Step 3: Install dependencies and build
- name: Install dependencies and build
run: |
npm install
npm run build
working-directory: src
# 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: ./src/out