name: Deploy Docs on: push: branches: [main] paths: - 'docs/**' - '.github/workflows/docs.yml' workflow_dispatch: permissions: contents: read pages: write id-token: write # Allow one concurrent deployment; don't cancel an in-progress run. concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' - name: Install dependencies run: pip install "jupyter-book<2" furo sphinx-design sphinxcontrib-mermaid - name: Build both language books run: | jupyter-book build docs/zh --path-output docs/_build/zh jupyter-book build docs/en --path-output docs/_build/en - name: Assemble site run: | rm -rf site mkdir -p site # Per-language books served under /zh/ and /en/. cp -r docs/_build/zh/_build/html site/zh cp -r docs/_build/en/_build/html site/en # Shared figures (referenced as ../figure/* from both books). cp -r docs/figure site/figure # Root redirect to the default (English) docs. cp docs/_landing/index.html site/index.html echo "reme.agentscope.io" > site/CNAME touch site/.nojekyll - name: Upload Pages artifact uses: actions/upload-pages-artifact@v3 with: path: site deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4