Mobile css polishing (#1605) #1071
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: Deploy MkDocs to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
paths: | |
- "autogen/**" | |
- "website/**" | |
- ".github/workflows/deploy-website.yml" | |
- ".github/workflows/docs-check-broken-links.yml" | |
- "scripts/broken-links-check.sh" | |
- "scripts/docs_build_mkdocs.sh" | |
- "scripts/docs_serve_mkdocs.sh" | |
- ".muffet-excluded-links.txt" | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
fetch-depth: 0 | |
- uses: astral-sh/setup-uv@v5 | |
with: | |
version: "latest" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
# Step 3: Build MkDocs | |
- name: Build documentation | |
run: | | |
uv venv | |
. .venv/bin/activate | |
uv pip install -e ".[docs]" | |
./scripts/docs_build_mkdocs.sh --force | |
ls -la ./website/mkdocs/site | |
working-directory: . | |
# Step 3: Configure Git user | |
- name: Configure Git user | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
# Step 4: Deploy to gh-pages branch | |
- name: Deploy to GitHub Pages | |
run: | | |
. .venv/bin/activate | |
# Get version directly from the package using a more reliable method | |
VERSION=$(python -c 'import os, sys; sys.path.insert(0, os.getcwd()); import autogen; print(".".join(autogen.__version__.split(".")[:3]))') | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
# Check if version contains "rc" | |
IS_RC=$(python -c 'import os, sys, re; sys.path.insert(0, os.getcwd()); import autogen; version = autogen.__version__; print(not bool(re.match(r"^[0-9]+(\.[0-9]+)*$", version)))') | |
echo "IS_RC=$IS_RC" >> $GITHUB_ENV | |
echo $VERSION | |
echo $IS_RC | |
if [ "$IS_RC" == "False" ]; then | |
cd website/mkdocs && mike deploy -F mkdocs.yml --update-aliases $VERSION latest | |
mike set-default --push --allow-empty -F mkdocs.yml latest | |
else | |
cd website/mkdocs && mike deploy --push -F mkdocs.yml --update-aliases $VERSION | |
fi | |
outputs: | |
is_rc: ${{ env.IS_RC }} | |
copy-latest-to-root: | |
needs: deploy | |
if: needs.deploy.outputs.is_rc == 'False' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
fetch-depth: 1 | |
- name: Configure Git user | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
- name: Copy latest docs to root | |
run: | | |
# Verify the latest directory exists or fail immediately | |
if [ ! -d "latest" ]; then | |
echo "ERROR: 'latest' directory not found in gh-pages branch" | |
echo "Current directory structure:" | |
ls -la | |
exit 1 | |
fi | |
# Copy content from latest to root (except index.html) | |
cd latest | |
cp -r $(ls -A | grep -v "index.html") ../ | |
cd .. | |
# Commit and push changes | |
git add . | |
git commit -m "Copy latest docs to root level (except index.html)" || echo "No changes to commit" | |
git push |