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