fix(docs): Fix document build error (#2271)

This commit is contained in:
Fangyin Cheng
2025-01-03 16:38:10 +08:00
committed by GitHub
parent 0e3b2dc818
commit de629f467d
3 changed files with 39 additions and 5 deletions

View File

@@ -6,9 +6,12 @@ on:
- main
paths:
- 'docs/**'
pull_request:
paths:
- 'docs/**'
release:
types: [published]
workflow_dispatch:
workflow_dispatch:
permissions:
contents: read
@@ -16,24 +19,29 @@ permissions:
jobs:
build-image:
runs-on: ubuntu-latest
# run unless event type is pull_request
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# Only login to Docker Hub when not in PR
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./docs/Dockerfile-deploy
platforms: linux/amd64
push: true
tags: eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest
# Only push when not in PR
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ github.event_name != 'pull_request' && 'eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest' || '' }}