name: Deploy to GitHub Pages
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Verify build output
run: |
ls -la ./build
if [ ! -d "./build" ] || [ -z "$(ls -A ./build)" ]; then
echo "❌ Build directory is missing or empty!"
exit 1
fi
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'