Skip to content

Deploy demo page

Deploy demo page #4

name: Deploy demo page
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Get pnpm store directory
id: pnpm-store-dir-path
run: echo "dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT
- name: Use pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-store-dir-path.outputs.dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build --base=./
- name: Add robots.txt
run: |
echo -e "User-agent: *\nDisallow: /" > ./dist/robots.txt
- name: Upload static files as artifact
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4