From b63042531375a6fd08034c1935c42cd2d5c2f41d Mon Sep 17 00:00:00 2001 From: dennisbader Date: Sun, 3 Nov 2024 13:47:05 +0100 Subject: [PATCH] update deploy github pages --- .github/workflows/doc.yml | 63 +++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 29 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 3da8fd10ee..9c55ceeac4 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -7,49 +7,54 @@ jobs: deploy-docs: runs-on: ubuntu-latest steps: - - name: "1. Clone repository" - uses: actions/checkout@v2 + - name: "Clone repository" + uses: actions/checkout@v4 - - name: "2. Set up Python 3.9" - uses: actions/setup-python@v1 + - name: "Set up Python 3.9" + uses: actions/setup-python@v5 with: python-version: '3.9' - - name: "3. Install pandoc" + # use `uv` to retrieve the latest dependency versions + - name: "Compile Dependency Versions" run: | - sudo apt-get install -y pandoc + curl -LsSf https://astral.sh/uv/install.sh | sh + uv pip compile requirements/dev-all.txt > requirements-latest.txt - # downloading gradle multiple times in parallel can yield to connection errors - - name: "4. Cache gradle distribution" - uses: actions/cache@v2 + # only restore cache but do not upload + - name: "Restore cached python environment" + uses: actions/cache/restore@v4 + id: pythonenv-cache with: - path: ~/.gradle/wrapper/dists - key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + path: ${{ env.pythonLocation }} + key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('requirements/*.txt', 'requirements-latest.txt') }} - - name: "4.1 Cache gradle packages" - uses: actions/cache@v2 - with: - path: ~/.gradle/caches - key: release-${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }} + - name: "Install pandoc" + run: | + sudo apt-get install -y pandoc - - name: "5. Setup pip" + - name: "Setup Pip" run: | - ./gradlew setupPip + python -m pip install --upgrade pip - - name: "6. Attach cache for pip" - uses: actions/cache@v1 - id: cache - with: - path: ~/.cache/pip - key: release-${{ runner.os }}-pip-${{ hashFiles('requirements/core.txt', 'requirements/release.txt') }} - restore-keys: | - release-${{ runner.os }}-pip- + - name: "Install Dependencies" + run: | + # install latest dependencies (potentially updating cached dependencies) + pip install -U -r requirements/dev-all.txt + + - name: "Install libomp (for LightGBM)" + run: | + ./.github/scripts/libomp-${{ runner.os }}.sh + + - name: "Install Locally" + run: | + pip install . - - name: "7. Build docs" + - name: "Build docs" run: | - ./gradlew buildDocs + make --directory ./docs build-all-docs - - name: "8. Publish documentation to gh-pages" + - name: "Publish documentation to gh-pages" uses: s0/git-publish-subdir-action@v2.2.0 env: REPO: self