openai-agents-python/.github/workflows/docs.yml
dependabot[bot] eccd8c85ee
fix(deps): bump actions/download-artifact from 8.0.1 to 8.0.2 (#5466)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](3e5f45b2cf...9000827ccb)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-04 19:56:46 +00:00

95 lines
2.8 KiB
YAML

name: Deploy docs
on:
push:
branches:
- main
paths:
- "docs/**"
- "mkdocs.yml"
- "uv.lock"
- ".github/workflows/docs.yml"
permissions: {}
concurrency:
group: docs-deploy
cancel-in-progress: false
queue: max
jobs:
build_docs:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
deploy: ${{ steps.docs-deploy.outputs.run }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Determine docs deployment changes
id: docs-deploy
env:
BASE_SHA: ${{ github.event.before }}
HEAD_SHA: ${{ github.sha }}
run: ./.github/scripts/detect-changes.sh docs-deploy
- name: Setup uv
if: steps.docs-deploy.outputs.run == 'true'
uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # setup-uv v9.0.0; uv 0.11.14
with:
version: "0.11.14"
enable-cache: true
prune-cache: true
python-version: "3.14"
- name: Install dependencies
if: steps.docs-deploy.outputs.run == 'true'
env:
UV_FROZEN: "1"
run: make sync
- name: Build docs
if: steps.docs-deploy.outputs.run == 'true'
env:
UV_FROZEN: "1"
run: make build-docs
- name: Upload site
if: steps.docs-deploy.outputs.run == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-site
path: site/
include-hidden-files: true
if-no-files-found: error
retention-days: 1
deploy_docs:
needs: build_docs
if: needs.build_docs.outputs.deploy == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout published branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
ref: gh-pages
path: published
- name: Download site
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: docs-site
path: site
- name: Publish static files
shell: bash
run: |
# Copy only static files; keep checkout metadata outside the artifact.
rsync --recursive --delete --exclude=.git site/ published/
touch published/.nojekyll
git -C published config user.name 'github-actions[bot]'
git -C published config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git -C published add --all
if ! git -C published diff --cached --quiet; then
git -C published commit -m "Deploy docs for $GITHUB_SHA"
git -C published push origin HEAD:gh-pages
fi