Skip to content

feat: Generate sidebar and nav by version and language #51

feat: Generate sidebar and nav by version and language

feat: Generate sidebar and nav by version and language #51

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches: ['master']
pull_request:
branches: ['master']
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [1.4.3] # 定义版本数组
steps:
- uses: actions/checkout@v3
- name: Checkout LingLong ${{ matrix.version }}
uses: actions/checkout@v4

Check failure on line 24 in .github/workflows/pages.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/pages.yml

Invalid workflow file

You have an error in your yaml syntax on line 24
with:
ref: ${{ matrix.version }} # 使用矩阵中的版本号作为检出的ref
path: ${{ matrix.version }} # 每个版本检出到不同的目录
- name: Generate Versions JS File
run: |
verPath=".vitepress/theme/versions.js"
echo "const versions = [''];" > $verPath
for ver in "${{ matrix.version }}"; do
echo "versions.push('$ver');" >> $verPath
done
echo "exports.versions = versions;" >> $verPath
cat $verPath
- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Install Depend
run: yarn install
- name: Build Pages
run: yarn build
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./.vitepress/dist
deploy:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1