Skip to content

Try GH pages deploy from actions #4

Try GH pages deploy from actions

Try GH pages deploy from actions #4

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
id: pnpm
shell: bash
run: echo "STORE_PATH=$(pnpm store path --silent)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Build website
run: pnpm build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: ./build
retention-days: 5
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: [ build ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Download artifact
id: download
uses: actions/download-artifact@v3
with:
name: build
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ steps.download.outputs.download-path }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2