Skip to content

Add Node.js setup step to deploy workflow #114

Add Node.js setup step to deploy workflow

Add Node.js setup step to deploy workflow #114

Workflow file for this run

# For deployment on GitHub Pages
name: GitHub Pages
# Deploy new site updates on direct push or through pull request
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# Where the real work starts
jobs:
deploy:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# This version specifically needed?
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies and build
run: |
npm ci
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
publish_branch: gh-pages # Optional, but good to be explicit