forked from openai/openai-agents-python
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.36 KB
/
docs.yml
File metadata and controls
47 lines (44 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Deploy docs
on:
push:
branches:
- main
paths:
- "docs/**"
- "mkdocs.yml"
permissions:
contents: write # This allows pushing to gh-pages
jobs:
deploy_docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Determine docs-only push
id: docs-only
run: |
if [ "${{ github.event_name }}" != "push" ]; then
echo "skip=false" >> "$GITHUB_OUTPUT"
exit 0
fi
set -euo pipefail
before="${{ github.event.before }}"
sha="${{ github.sha }}"
changed_files=$(git diff --name-only "$before" "$sha" || true)
non_docs=$(echo "$changed_files" | grep -vE '^(docs/|mkdocs.yml$)' || true)
if [ -n "$non_docs" ]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- name: Setup uv
if: steps.docs-only.outputs.skip != 'true'
uses: astral-sh/setup-uv@5a095e7a2014a4212f075830d4f7277575a9d098
with:
enable-cache: true
- name: Install dependencies
if: steps.docs-only.outputs.skip != 'true'
run: make sync
- name: Deploy docs
if: steps.docs-only.outputs.skip != 'true'
run: make deploy-docs