xref: /DragonOS/.github/workflows/docs-multiversion.yml (revision 9ad34ef277ae9e5444c00dc9e1d7d013a86a3c64)
1c635d8a9SLoGinname: Build multiversion docs
2c635d8a9SLoGin
3c635d8a9SLoGinon:
4c635d8a9SLoGin  push:
5c635d8a9SLoGin    branches: [ "master" ]
6c635d8a9SLoGin    tags: [ "v*", "V*"]
7c635d8a9SLoGin
8c635d8a9SLoGinenv:
9c635d8a9SLoGin    GITHUB_REPOSITORY: ${{ github.repository }}
10c635d8a9SLoGin    GITHUB_REF: ${{ github.ref }}
11c635d8a9SLoGin
12c635d8a9SLoGinjobs:
13c635d8a9SLoGin
14c635d8a9SLoGin  build-multiversion:
15c635d8a9SLoGin    if: github.repository == 'DragonOS-Community/DragonOS'
16c635d8a9SLoGin    runs-on: ubuntu-latest
17c635d8a9SLoGin
18c635d8a9SLoGin    steps:
19c635d8a9SLoGin    - uses: actions/checkout@v4
20c635d8a9SLoGin      with:
21c635d8a9SLoGin        fetch-depth: 0
22c635d8a9SLoGin        ref: master
23c635d8a9SLoGin
24c635d8a9SLoGin    - name: install requirements
25c635d8a9SLoGin      working-directory: ./docs
26c635d8a9SLoGin      run: |
27c635d8a9SLoGin        sudo apt-get update
28*9ad34ef2SLoGin        sudo apt-get install -y python3-pip python3-setuptools
29c635d8a9SLoGin        pip3 install -r requirements.txt
30*9ad34ef2SLoGin        python3 -m pip install --user awscli
31c635d8a9SLoGin
32c635d8a9SLoGin    - name: build docs
33c635d8a9SLoGin      working-directory: ./docs
34c635d8a9SLoGin      shell: bash -ileo pipefail {0}
35c635d8a9SLoGin
36c635d8a9SLoGin      run: |
37c635d8a9SLoGin        make html-multiversion
382f9b18baSLoGin
392f9b18baSLoGin    - name: deploy docs
402f9b18baSLoGin      working-directory: ./docs
412f9b18baSLoGin      env:
422f9b18baSLoGin        AWS_ENDPOINT_URL: ${{ secrets.DOCS_DEPLOY_S3_ENDPOINT_URL }}
432f9b18baSLoGin        AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_DEPLOY_S3_API_KEY }}
442f9b18baSLoGin        AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_DEPLOY_S3_SECRET_KEY }}
452f9b18baSLoGin
462f9b18baSLoGin      run: |
472f9b18baSLoGin        aws s3 sync ./_build/html s3://dragonos-docs --delete
48