Merge pull request #7105 from voxel51/josh/release-notes-1.13.3 #15787
This file contains hidden or 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: Build docs | |
| on: | |
| push: | |
| branches: | |
| - docs-* | |
| - github-actions-* | |
| - rel-* | |
| - release-* | |
| - release/* | |
| tags: | |
| - dev-docs-publish | |
| - docs-publish | |
| - v* | |
| paths: | |
| - .github/workflows/build-docs.yml | |
| - docs/** | |
| - examples/** | |
| - fiftyone/** | |
| - "**.py" | |
| - "**.md" | |
| - "**.rst" | |
| pull_request: | |
| branches: | |
| - develop | |
| - feat/* | |
| - main | |
| - rel-* | |
| - release-* | |
| - release/* | |
| paths: | |
| - .github/workflows/build-docs.yml | |
| - docs/** | |
| - examples/** | |
| - fiftyone/** | |
| - requirements/** | |
| - "**.py" | |
| - "**.md" | |
| - "**.rst" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| FIFTYONE_DO_NOT_TRACK: true | |
| DOCSEARCH_API_KEY: ${{ secrets.DOCSEARCH_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.FIFTYONE_GITHUB_TOKEN }} | |
| steps: | |
| - name: Clone fiftyone for tag builds | |
| if: github.ref_type == 'tag' | |
| uses: actions/checkout@v6 | |
| with: | |
| # Fetch full history for rev-parse to work | |
| fetch-depth: 0 | |
| - name: Clone fiftyone for branch builds | |
| if: github.ref_type == 'branch' | |
| uses: actions/checkout@v6 | |
| - name: Get Branch Name | |
| id: get_branch | |
| run: | | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| TAG_SHA=$(git rev-parse ${{ github.ref }}) | |
| case "${{ github.ref_name }}" in | |
| docs-publish|v*) | |
| MAIN_SHA=$(git rev-parse origin/main) | |
| if [[ "${MAIN_SHA}" == "${TAG_SHA}" ]]; then | |
| echo "branch_name=main" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "docs-publish should only be performed on 'main'" | |
| exit 1 | |
| fi | |
| ;; | |
| dev-docs-publish) | |
| DEVELOP_SHA=$(git rev-parse origin/develop) | |
| if [[ "${DEVELOP_SHA}" == "${TAG_SHA}" ]]; then | |
| echo "branch_name=develop" >> "${GITHUB_OUTPUT}" | |
| else | |
| echo "dev-docs-publish should only be performed on 'develop'" | |
| exit 1 | |
| fi | |
| ;; | |
| esac | |
| else | |
| case "${{ github.ref_name }}" in | |
| main|develop) | |
| echo "branch_name=${{ github.ref_name }}" >> "${GITHUB_OUTPUT}" | |
| ;; | |
| *) | |
| # use `main` because arbitrary branch names may not exist on `fiftyone-teams` or `eta` | |
| echo "branch_name=main" >> "${GITHUB_OUTPUT}" | |
| ;; | |
| esac | |
| fi | |
| - name: Checkout fiftyone-teams | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: voxel51/fiftyone-teams | |
| path: fiftyone-teams | |
| token: ${{ secrets.RO_FOT_FG_PAT }} | |
| ref: ${{ steps.get_branch.outputs.branch_name }} | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Free Disk Space (Ubuntu) # standard runner's 14 GB available disk size isn't enough. Need at least 22 GB free. | |
| uses: jlumbroso/[email protected] | |
| with: | |
| large-packages: false # e2e test failed when `true` | |
| - name: Install pip dependencies | |
| run: | | |
| pip install --upgrade pip setuptools wheel build | |
| - name: Install ETA from source | |
| run: | | |
| git clone https://github.com/voxel51/eta eta --depth 1 --branch "${{ steps.get_branch.outputs.branch_name }}" | |
| cd eta | |
| python -Im build | |
| pip install ./dist/*.whl | |
| - name: Install | |
| run: | | |
| echo "Installing system dependencies" | |
| sudo apt-get install pandoc | |
| echo "Installing docs requirements" | |
| pip install -r requirements/docs.txt | |
| echo "Installing fiftyone-brain and fiftyone-db" | |
| pip install fiftyone-brain fiftyone-db | |
| echo "Installing fiftyone" | |
| pip install . | |
| - name: Setup node 22 | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Prepare yarn 4 | |
| run: corepack prepare [email protected] --activate | |
| - name: Cache Node Modules | |
| id: node-cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| app/node_modules | |
| app/.yarn/cache | |
| key: node-modules-${{ hashFiles('app/yarn.lock') }} | |
| - name: Install app | |
| if: steps.node-cache.outputs.cache-hit != 'true' | |
| run: cd app && yarn install | |
| - name: Build docs | |
| run: | | |
| ./docs/generate_docs.bash -t fiftyone-teams | |
| - name: Upload docs | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: docs | |
| path: docs/build/html/ | |
| outputs: | |
| branch_name: ${{ steps.get_branch.outputs.branch_name}} | |
| publish: | |
| needs: [build] | |
| if: | | |
| needs.build.outputs.branch_name == 'main' && | |
| (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/tags/docs-publish') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download docs | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: docs | |
| path: docs-download/ | |
| - name: Authorize gcloud | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: "${{ secrets.DOCS_GCP_CREDENTIALS }}" | |
| - name: Set up gcloud | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: publish | |
| run: gsutil -m rsync -dR -x '^SBOMs/.*' docs-download gs://docs.voxel51.com | |
| dev-publish: | |
| needs: [build] | |
| if: | | |
| needs.build.outputs.branch_name == 'develop' && | |
| github.ref == 'refs/tags/dev-docs-publish' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download docs | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: docs | |
| path: docs-download/ | |
| - name: Authorize gcloud | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: "${{ secrets.DOCS_GCP_CREDENTIALS }}" | |
| - name: Set up gcloud | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: publish | |
| run: gsutil -m rsync -dR -x '^robots.txt' docs-download gs://docs.dev.voxel51.com |