chore: update docs #103
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: 317ef66813e413adafeae5b01186b34eda514248 # 指定玲珑项目的 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 |