XiaoDaiGua-Ray d489235be0
build(pages): deploy through GitHub Actions artifacts
Use Ubuntu 24.04 and Node 24 Pages actions for builds from main.
2026-11-06 23:50:04 +08:00

55 lines
1.4 KiB
YAML

name: Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build admin and documentation
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@v7.1.0
with:
node-version-file: .nvmrc
- uses: pnpm/action-setup@v6.1.0
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build admin and documentation
run: pnpm pages:build
env:
RAY_TEMPLATE_SITE_ORIGIN: ${{ github.repository == 'XiaoDaiGua-Ray/ray-template' && 'https://xiaodaigua-ray.github.io' || vars.RAY_TEMPLATE_SITE_ORIGIN }}
RAY_TEMPLATE_SOURCE_REF: ${{ github.sha }}
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5.0.0
with:
path: dist/pages
include-hidden-files: true
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Publish Pages artifact
id: deployment
uses: actions/deploy-pages@v5.0.1