Skip to content

Commit f850354

Browse files
committed
Sync docs into humemai-docs
1 parent 040128f commit f850354

1 file changed

Lines changed: 48 additions & 23 deletions

File tree

.github/workflows/deploy-python-docs.yml

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,15 @@ jobs:
5858
working-directory: bindings/python
5959
run: |
6060
pip install --upgrade pip
61-
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mike
61+
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin
6262
63-
- name: Configure Git
63+
- name: Validate docs token
6464
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
6565
run: |
66-
git config user.name "github-actions[bot]"
67-
git config user.email "github-actions[bot]@users.noreply.github.com"
6866
if [ -z "${{ secrets.HUMEMAI_DOCS_TOKEN }}" ]; then
6967
echo "HUMEMAI_DOCS_TOKEN is missing"
7068
exit 1
7169
fi
72-
git config --global url."https://x-access-token:${{ secrets.HUMEMAI_DOCS_TOKEN }}@github.com/".insteadOf "https://github.com/"
73-
git remote add humemai-docs "https://github.com/${{ env.DOCS_REPO }}.git"
7470
7571
- name: Extract version from tag or input
7672
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
@@ -88,27 +84,56 @@ jobs:
8884
echo "set_latest=$SET_LATEST" >> $GITHUB_OUTPUT
8985
echo "📦 Deploying documentation version: $VERSION"
9086
91-
- name: Deploy with mike (set as latest)
92-
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && steps.version.outputs.set_latest == 'true'
87+
- name: Checkout humemai-docs
88+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
89+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
90+
with:
91+
repository: ${{ env.DOCS_REPO }}
92+
ref: ${{ env.DOCS_BRANCH }}
93+
token: ${{ secrets.HUMEMAI_DOCS_TOKEN }}
94+
path: humemai-docs
95+
96+
- name: Build documentation
97+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
9398
working-directory: bindings/python
9499
env:
95100
MIKE_VERSION: ${{ steps.version.outputs.version }}
96101
run: |
97-
mike deploy --push --update-aliases --deploy-prefix arcadedb \
98-
--remote humemai-docs --branch ${{ env.DOCS_BRANCH }} \
99-
${{ steps.version.outputs.version }} latest \
100-
--title "${{ steps.version.outputs.version }} (latest)"
101-
mike set-default --push --deploy-prefix arcadedb \
102-
--remote humemai-docs --branch ${{ env.DOCS_BRANCH }} \
103-
latest
102+
mkdocs build -f mkdocs.yml -d /tmp/site
104103
105-
- name: Deploy with mike (not latest)
106-
if: (github.event_name == 'workflow_dispatch' || github.event_name == 'push') && steps.version.outputs.set_latest != 'true'
107-
working-directory: bindings/python
104+
- name: Publish docs to humemai-docs
105+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
108106
env:
109-
MIKE_VERSION: ${{ steps.version.outputs.version }}
107+
VERSION: ${{ steps.version.outputs.version }}
108+
SET_LATEST: ${{ steps.version.outputs.set_latest }}
110109
run: |
111-
mike deploy --push --deploy-prefix arcadedb \
112-
--remote humemai-docs --branch ${{ env.DOCS_BRANCH }} \
113-
${{ steps.version.outputs.version }} \
114-
--title "${{ steps.version.outputs.version }}"
110+
set -e
111+
DEST="humemai-docs/arcadedb/${VERSION}"
112+
mkdir -p "$DEST"
113+
rsync -a --delete /tmp/site/ "$DEST/"
114+
115+
if [ "$SET_LATEST" = "true" ]; then
116+
mkdir -p humemai-docs/arcadedb/latest
117+
rsync -a --delete /tmp/site/ humemai-docs/arcadedb/latest/
118+
cat > humemai-docs/arcadedb/index.html <<'EOF'
119+
<!doctype html>
120+
<html lang="en">
121+
<head>
122+
<meta charset="utf-8" />
123+
<meta http-equiv="refresh" content="0; url=/arcadedb/latest/" />
124+
<meta name="robots" content="noindex" />
125+
<title>Redirecting…</title>
126+
</head>
127+
<body>
128+
<p>Redirecting to <a href="/arcadedb/latest/">/arcadedb/latest/</a></p>
129+
</body>
130+
</html>
131+
EOF
132+
fi
133+
134+
cd humemai-docs
135+
git config user.name "github-actions[bot]"
136+
git config user.email "github-actions[bot]@users.noreply.github.com"
137+
git add arcadedb
138+
git commit -m "Publish ArcadeDB docs ${VERSION}" || echo "No changes to commit"
139+
git push

0 commit comments

Comments
 (0)