From 39bc5a76862c9fbbe280b8a1f8d7dbd9b65fd4dc Mon Sep 17 00:00:00 2001 From: Romain Marcadier Date: Fri, 20 May 2022 11:21:59 +0000 Subject: [PATCH] chore: use a venv to buidl github pages --- .github/workflows/gh-pages.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 5b7af8dc56..f35be90610 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -19,26 +19,21 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: + cache: 'pip' + cache-dependency-path: 'gh-pages/requirements-dev.txt' python-version: '3.8' - name: Check out uses: actions/checkout@v3 - - name: Locate Caches - id: cache-locations - run: |- - echo "::set-output name=pip-cache::$(python3 -m pip cache dir)" - - name: Cache - uses: actions/cache@v3 - with: - path: ${{ steps.cache-locations.outputs.pip-cache }} - key: ${{ runner.os }}-${{ hashFiles('**/requirements-dev.txt') }} - restore-keys: ${{ runner.os }}- - name: Install Dependencies run: |- - pip install -r requirements-dev.txt + python3 -m venv ${{ runner.temp }}/venv + source ${{ runner.temp }}/venv/bin/activate + python3 -m pip install -r requirements-dev.txt working-directory: gh-pages - name: Build DocSite run: |- mkdir -p ${{ runner.temp }}/site + source ${{ runner.temp }}/venv/bin/activate mkdocs build \ --strict \ --site-dir ${{ runner.temp }}/site @@ -52,7 +47,7 @@ jobs: publish: name: Publish needs: build - if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' + if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' permissions: contents: write runs-on: ubuntu-latest