Skip to content

Commit 898e289

Browse files
Merge pull request #103 from harishmohanraj/docs-versioning
Configure mkdocs versioning
2 parents 26c4fc0 + b29a0f5 commit 898e289

File tree

4 files changed

+33
-22
lines changed

4 files changed

+33
-22
lines changed

.github/workflows/deploy-website.yml

+20-9
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,24 @@ jobs:
4343
ls -la ./website/mkdocs/site
4444
working-directory: .
4545

46-
# Step 3: Deploy to gh-pages branch
46+
# Step 3: Configure Git user
47+
- name: Configure Git user
48+
run: |
49+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
50+
git config --local user.name "github-actions[bot]"
51+
52+
# Step 4: Deploy to gh-pages branch
4753
- name: Deploy to GitHub Pages
48-
uses: peaceiris/actions-gh-pages@v4
49-
with:
50-
github_token: ${{ secrets.GITHUB_TOKEN }}
51-
publish_dir: ./website/mkdocs/site
52-
force_orphan: true
53-
user_name: 'github-actions[bot]'
54-
user_email: 'github-actions[bot]@users.noreply.github.com'
55-
commit_message: 'Deploy MkDocs site to GitHub pages'
54+
run: |
55+
echo "VERSION=$(python3 -c 'from importlib.metadata import version; print(".".join(version("pyautogen").split(".")[:3]))')" >> $GITHUB_ENV
56+
echo "IS_RC=$(python3 -c 'from importlib.metadata import version; print("rc" in version("pyautogen"))')" >> $GITHUB_ENV
57+
58+
echo $VERSION
59+
echo $IS_RC
60+
61+
if [ "$IS_RC" == "False" ]; then
62+
cd website/mkdocs && mike deploy -F mkdocs.yml --update-aliases $VERSION latest
63+
mike set-default --push --allow-empty -F mkdocs.yml latest
64+
else
65+
cd website/mkdocs && mike deploy --push -F mkdocs.yml --update-aliases $VERSION
66+
fi

website/mkdocs/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# :warning: DOCUMENTATION CODE SOURCES :warning:
22

3-
To find a real docs, just visit our website: [https://faststream.airt.ai/latest/](https://faststream.airt.ai/latest/)
3+
To find a real docs, just visit our website: [http://docs.ag2.ai/latest/](http://docs.ag2.ai/latest/)

website/mkdocs/mkdocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,5 @@ extra:
161161
- icon: fontawesome/brands/linkedin
162162
link: https://www.linkedin.com/company/ag2ai
163163

164-
# version:
165-
# provider: mike
164+
version:
165+
provider: mike

website/mkdocs/templates/redirect.html

+10-10
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
</noscript>
1010

1111
<!-- Google tag (gtag.js) -->
12-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-HDTMP5FFHP"></script>
12+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2GN2KN2CE4"></script>
1313
<script>
1414
window.dataLayer = window.dataLayer || [];
1515
function gtag() { dataLayer.push(arguments); }
1616
gtag('js', new Date());
1717

18-
gtag('config', 'G-HDTMP5FFHP');
18+
gtag('config', 'G-2GN2KN2CE4');
1919
</script>
2020

2121
<script>
@@ -25,7 +25,7 @@
2525

2626
// Use the referrer if valid, otherwise use the existingReferrer
2727
const referrer = document.referrer;
28-
const isReferrerValid = referrer && !referrer.includes("faststream.airt.ai");
28+
const isReferrerValid = referrer && !referrer.includes("docs.ag2.ai");
2929
const validReferrer = isReferrerValid ? referrer : existingReferrer;
3030

3131
if (validReferrer) {
@@ -43,17 +43,17 @@
4343
</script>
4444

4545
<meta property="og:type" content="website" />
46-
<meta property="og:title" content="FastStream" />
47-
<meta property="og:description" content="FastStream Python messaging framework documentation" />
48-
<meta property="og:url" content="https://faststream.airt.ai/latest/" />
49-
<meta property="og:image" content="https://opengraph.githubassets.com/1671805243.560327/airtai/faststream" />
46+
<meta property="og:title" content="AG2" />
47+
<meta property="og:description" content="A programming framework for agentic AI" />
48+
<meta property="og:url" content="docs.ag2.ailatest/" />
49+
<meta property="og:image" content="https://opengraph.githubassets.com/1671805243.560327/ag2ai/ag2" />
5050
<meta property="og:image:type" content="image/png" />
5151
<meta property="og:image:width" content="1200" />
5252
<meta property="og:image:height" content="630" />
5353
<meta name="twitter:card" content="summary_large_image" />
54-
<meta name="twitter:title" content="FastStream" />
55-
<meta name="twitter:description" content="FastStream Python messaging framework documentation" />
56-
<meta name="twitter:image" content="https://opengraph.githubassets.com/1671805243.560327/airtai/faststream" />
54+
<meta name="twitter:title" content="AG2" />
55+
<meta name="twitter:description" content="A programming framework for agentic AI" />
56+
<meta name="twitter:image" content="https://opengraph.githubassets.com/1671805243.560327/ag2ai/ag2" />
5757
</head>
5858

5959
<body>

0 commit comments

Comments
 (0)