diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7b1c3bd79..26b3895ed 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,8 +13,8 @@ concurrency: jobs: build: name: Build documentation - runs-on: ubuntu-lates - stages: + runs-on: ubuntu-latest + steps: - name: 🛒 Checkout uses: actions/checkout@v4 with: @@ -39,3 +39,42 @@ jobs: with: name: lenskit-docs path: build/doc + publish: + name: Publish documentation + runs-on: ubuntu-latest + needs: + - build + environment: docs + steps: + - id: decrypt + name: 🔓 Decrypt deployment key + run: | + tmpdir=$(mktemp -d lksite.XXXXXX) + echo "$AGE_DECRYPT" >$tmpdir/decrypt-identity + echo 'deploy-key<>$GITHUB_OUTPUT + age -d -i $tmpdir/decrypt-identity etc/doc-deploy-key.asc >>$GITHUB_OUTPUT + echo 'EOK' >>$GITHUB_OUTPUT + rm -rf $tmpdir + env: + AGE_DECRYPT: ${{ secrets.DOC_DEPLOY_DECRYPT_KEY }} + - name: Check out doc site + uses: actions/checkout@v4 + with: + repository: lenskit/lenskit-docs + ssh-key: ${{steps.decrypt.output.decrypt-identity}} + path: doc-site + ref: latest + - name: 📥 Fetch documentation package + uses: actions/download-artifact@v4 + with: + name: lenskit-docs + path: build/doc + - name: 🛻 Copy documentation content + run: | + rsync -av --delete --exclude=.git/ build/doc/ doc-site/ + cd doc-site + git config user.name "LensKit Doc Bot" + git config user.email "docbot@lenskit.org" + git add . + git commit -m 'rebuild documentation' + git push diff --git a/docs/environment.yml b/docs/environment.yml index 6870c9782..0237fe9d3 100644 --- a/docs/environment.yml +++ b/docs/environment.yml @@ -12,7 +12,7 @@ dependencies: - just - pytorch-cpu - nomkl - - pandas <3,>=1.5 + - pandas >=1.5,<3 - numpy >=1.23,<2 - scipy >=1.9.0 - pytorch >=2.1,<3 diff --git a/lkdev/workflows/docs.py b/lkdev/workflows/docs.py index f1cd4c111..9548c9c9b 100644 --- a/lkdev/workflows/docs.py +++ b/lkdev/workflows/docs.py @@ -22,15 +22,18 @@ def workflow(): "group": "test-${{github.ref}}", "cancel-in-progress": True, }, - "jobs": {"build": job_build_docs()}, + "jobs": { + "build": job_build_docs(), + "publish": job_publish_docs(), + }, } def job_build_docs(): return { "name": "Build documentation", - "runs-on": "ubuntu-lates", - "stages": stages_setup() + stages_build_doc() + stages_package(), + "runs-on": "ubuntu-latest", + "steps": stages_setup() + stages_build_doc() + stages_package(), }