ci(docs): Build docs when push/PR to master and release version. (#935)

Signed-off-by: longjin <longjin@DragonOS.org>
This commit is contained in:
LoGin
2024-09-25 01:36:57 +08:00
committed by GitHub
parent 28fe4ad2a0
commit c635d8a9cf
6 changed files with 115 additions and 2 deletions

36
.github/workflows/docs-multiversion.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Build multiversion docs
on:
push:
branches: [ "master" ]
tags: [ "v*", "V*"]
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
jobs:
build-multiversion:
if: github.repository == 'DragonOS-Community/DragonOS'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
- name: install requirements
working-directory: ./docs
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install -r requirements.txt
- name: build docs
working-directory: ./docs
shell: bash -ileo pipefail {0}
run: |
make html-multiversion

34
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: Build current version docs
on:
pull_request:
branches: [ "master" ]
# paths:
# - 'docs/**'
env:
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
jobs:
build-current-version:
if: github.repository == 'DragonOS-Community/DragonOS'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install requirements
working-directory: ./docs
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
pip3 install -r requirements.txt
- name: build docs
working-directory: ./docs
shell: bash -ileo pipefail {0}
run: |
make html