Skip to content

Commit 256722d

Browse files
committed
feat: ajust deploy for searchmap and robots
1 parent 056c0be commit 256722d

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ name: Deploy MkDocs Page with Mike
33
on:
44
push:
55
tags:
6-
- 'v*.*.*'
7-
- 'v*.*.*.doc.*'
6+
- "v*.*.*"
7+
- "v*.*.*.doc.*"
88
workflow_dispatch:
99
inputs:
1010
version:
11-
description: 'Version tag to deploy (e.g., v1.2.0.doc.1)'
11+
description: "Version tag to deploy (e.g., v1.2.0.doc.1)"
1212
required: true
1313
type: string
1414

@@ -44,7 +44,7 @@ jobs:
4444
- name: Install Python
4545
uses: actions/setup-python@v5
4646
with:
47-
python-version: '3.12'
47+
python-version: "3.12"
4848

4949
- name: Install Poetry
5050
run: pip install poetry
@@ -60,7 +60,7 @@ jobs:
6060
else
6161
TAG=${GITHUB_REF##*/}
6262
fi
63-
63+
6464
if [[ $TAG =~ ^v([0-9]+\.[0-9]+)\.[0-9]+\.doc\.[0-9]+$ ]]; then
6565
VERSION="${BASH_REMATCH[1]}.x"
6666
elif [[ $TAG =~ ^v([0-9]+\.[0-9]+)\.[0-9]+$ ]]; then
@@ -69,7 +69,7 @@ jobs:
6969
echo "Error: Tag format not recognized: $TAG"
7070
exit 1
7171
fi
72-
72+
7373
echo "VERSION=$VERSION" >> $GITHUB_ENV
7474
echo "TAG=$TAG" >> $GITHUB_ENV
7575
echo "Deploying version: $VERSION (from tag: $TAG)"
@@ -83,15 +83,20 @@ jobs:
8383
poetry run mike deploy --update-aliases ${VERSION} latest
8484
poetry run mike set-default latest
8585
86-
- name: Copy Google Verification File to Root
86+
- name: Update Root Files (Verification + Robots.txt)
8787
run: |
8888
git checkout gh-pages
89+
90+
# Copy verification file if exists
8991
cp ${VERSION}/googleb888a8ce45bda477.html . || echo "Verification file not found in version, skipping"
90-
git add googleb888a8ce45bda477.html
91-
git commit -m "chore: add Google verification file to root" || echo "No changes to commit"
92+
93+
# Generate robots.txt
94+
echo "User-agent: *" > robots.txt
95+
echo "Sitemap: https://open-ev-data.github.io/latest/sitemap.xml" >> robots.txt
96+
97+
git add googleb888a8ce45bda477.html robots.txt
98+
git commit -m "chore: update root files (verification + robots.txt)" || echo "No changes to commit"
9299
93100
- name: Push Changes
94101
run: |
95102
git push origin gh-pages
96-
97-

0 commit comments

Comments
 (0)