Skip to content

feat: initial site

feat: initial site #14

name: Deploy a Preview Site
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "latest"
- run: npm install -g pnpm
- run: pnpm install
- run: sed -i "s|/docs|/docs/branches/${GITHUB_HEAD_REF}|g" nuxt.config.ts; cat nuxt.config.ts
- run: pnpm nuxt build --preset github_pages
- run: |
mkdir -p dist/branches/${{ github.head_ref }}
mv .output/public/* dist/branches/${{ github.head_ref }} || exit 0
- uses: actions/upload-pages-artifact@v3
with:
name: "Project Documentation"
path: "dist"
deploy:
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: "Project Documentation"