Skip to content

specify node version #64

specify node version

specify node version #64

Workflow file for this run

name: Publish to GH pages
on:
push:
branches: [main]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.11.0]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm-route
shell: bash
run: |
echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules-v1
with:
path: ${{ steps.pnpm-route.outputs.PNPM_STORE_PATH }}
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: Install Node modules
run: pnpm i
- name: Build
run: npm run build
- run: npm install -g surge
- run: surge dist ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}