Skip to content

pnpm workflow

pnpm workflow #553

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
paths-ignore:
- '**/*.md'
jobs:
build:
name: "Build Harry Potter Quiz application"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm run build
- run: pnpm test
- uses: actions/upload-artifact@v4
name: Upload build as artifact
if: always()
with:
name: hpquiz-dist
path: ./dist
deploy-on-github-pages:
name: "Deploy app to GitHub Pages from main branch source code"
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: hpquiz-dist
path: ./dist
- name: Deploy app as GitHub Pages
uses: peaceiris/actions-gh-pages@v3.7.0-6
if: ${{ github.event_name != 'pull_request' && always() }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "./dist"
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
force_orphan: true
keep_files: false