Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(api): add CORS headers and OPTIONS handler for preflight requests #22

fix(api): add CORS headers and OPTIONS handler for preflight requests

fix(api): add CORS headers and OPTIONS handler for preflight requests #22

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
env:
CI: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
- name: Chinese Text Lint (zhlint)
run: pnpm lint:zh
continue-on-error: true
build:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Cache VitePress
uses: actions/cache@v4
with:
path: .vitepress/cache
key: ${{ runner.os }}-vitepress-${{ hashFiles('**/*.md') }}
restore-keys: |
${{ runner.os }}-vitepress-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
env:
VITEPRESS_BASE: /halolight/
- name: Deploy to halolight/halolight gh-pages
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.DEPLOY_TOKEN }}
external_repository: halolight/halolight
publish_branch: gh-pages
publish_dir: .vitepress/dist
force_orphan: true
- name: Output deployment URL
run: |
echo "::notice::Deployed to https://halolight.docs.h7ml.cn/"
echo "## Deployment Complete" >> $GITHUB_STEP_SUMMARY
echo "Site deployed to: https://halolight.docs.h7ml.cn/" >> $GITHUB_STEP_SUMMARY