Skip to content

Update pages.yml

Update pages.yml #108

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.5.0'] # 定义版本数组
steps:
- uses: actions/checkout@v3
- name: Checkout linglong ${{ matrix.version }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.version }} # 使用矩阵中的版本号作为检出的ref
path: ${{ matrix.version }} # 每个版本检出到不同的目录
repository: linuxdeepin/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
- name: Checkout linglong release
uses: actions/checkout@v4
with:
ref: aef466bd48eb714e5376c064459dbe2ca117e115 # 指定玲珑项目的 commit 提交,可能文档有小部分修改,不需要从 tag 获取
path: tmp
repository: linuxdeepin/linglong
sparse-checkout: |
docs/pages
sparse-checkout-cone-mode: false
- name: set release version
run: |
rm -rf en guide
mv tmp/docs/pages/guide .
mv tmp/docs/pages/en .
- 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