mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-29 05:10:56 +00:00
fix(docs): Fix document build error (#2271)
This commit is contained in:
parent
0e3b2dc818
commit
de629f467d
18
.github/workflows/doc-image-publish.yml
vendored
18
.github/workflows/doc-image-publish.yml
vendored
@ -6,9 +6,12 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'docs/**'
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@ -16,24 +19,29 @@ permissions:
|
|||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# run unless event type is pull_request
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
# Only login to Docker Hub when not in PR
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docs/Dockerfile-deploy
|
file: ./docs/Dockerfile-deploy
|
||||||
platforms: linux/amd64
|
platforms: linux/amd64
|
||||||
push: true
|
# Only push when not in PR
|
||||||
tags: eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
|
tags: ${{ github.event_name != 'pull_request' && 'eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest' || '' }}
|
@ -51,6 +51,19 @@ RUN git config --global --add safe.directory /app && \
|
|||||||
echo "Creating version $TAG"; \
|
echo "Creating version $TAG"; \
|
||||||
cd /app/docs && git checkout $TAG; \
|
cd /app/docs && git checkout $TAG; \
|
||||||
echo "Checked out to tag: $TAG"; \
|
echo "Checked out to tag: $TAG"; \
|
||||||
|
# Check if there is a patch for the current version in app-build
|
||||||
|
echo "Checking patch in /app-build/docs/patchs..." && \
|
||||||
|
if [ -f "/app-build/docs/patchs/fix_${TAG/v/}.patch" ]; then \
|
||||||
|
echo "Found patch for version $TAG in /app-build/docs/patchs, applying..."; \
|
||||||
|
cd /app && \
|
||||||
|
git apply "/app-build/docs/patchs/fix_${TAG/v/}.patch" && \
|
||||||
|
echo "Patch applied successfully" || \
|
||||||
|
echo "Failed to apply patch for $TAG"; \
|
||||||
|
echo "Current sidebars.js content:"; \
|
||||||
|
cat /app/docs/sidebars.js; \
|
||||||
|
else \
|
||||||
|
echo "No patch found for $TAG in /app-build/docs/patchs"; \
|
||||||
|
fi; \
|
||||||
# Copy the necessary files to the build directory for each tag
|
# Copy the necessary files to the build directory for each tag
|
||||||
rm -rf /app-build/docs/docs /app-build/docs/sidebars.js /app-build/docs/static /app-build/docs/src && \
|
rm -rf /app-build/docs/docs /app-build/docs/sidebars.js /app-build/docs/static /app-build/docs/src && \
|
||||||
cp -r /app/docs/docs /app-build/docs/ && \
|
cp -r /app/docs/docs /app-build/docs/ && \
|
||||||
|
13
docs/patchs/fix_0.6.3.patch
Normal file
13
docs/patchs/fix_0.6.3.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/docs/sidebars.js b/docs/sidebars.js
|
||||||
|
index e95be6d2..561bc8f7 100755
|
||||||
|
--- a/docs/sidebars.js
|
||||||
|
+++ b/docs/sidebars.js
|
||||||
|
@@ -186,7 +186,7 @@ const sidebars = {
|
||||||
|
id: "awel/awel_tutorial/advanced_guide/4.1_lifecycle"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
- },,
|
||||||
|
+ },
|
||||||
|
{
|
||||||
|
type: "category",
|
||||||
|
label: "5. AWEL Template",
|
Loading…
Reference in New Issue
Block a user