File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 11name : Build and push docs image
2-
32on :
43 push :
54 branches :
1413 release :
1514 types : [published]
1615 workflow_dispatch :
17-
16+ inputs :
17+ branch :
18+ description : ' Branch to build (default: main)'
19+ required : true
20+ default : ' main'
21+ type : string
1822permissions :
1923 contents : read
20-
2124jobs :
2225 build-image :
2326 runs-on : ubuntu-latest
2427 steps :
2528 - uses : actions/checkout@v3
29+ with :
30+ fetch-depth : 0
31+ ref : ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref }}
32+
33+ - name : Debug git status
34+ run : |
35+ echo "Current commit: $(git rev-parse HEAD)"
36+ echo "Current branch: $(git rev-parse --abbrev-ref HEAD || echo 'detached HEAD')"
37+ echo "Main branch commit: $(git rev-parse origin/main)"
38+ echo "Using branch: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || github.ref_name }}"
2639
2740 - name : Set up QEMU
2841 uses : docker/setup-qemu-action@v2
4760 file : ./docs/Dockerfile-deploy
4861 platforms : linux/amd64
4962 push : false
63+
5064 # Only run when it is not a PR, build and push the image
5165 - name : Build and push
5266 if : github.event_name != 'pull_request'
5670 file : ./docs/Dockerfile-deploy
5771 platforms : linux/amd64
5872 push : true
59- tags : eosphorosai/dbgpt-docs:${{ github.ref_name }},eosphorosai/dbgpt-docs:latest
73+ tags : eosphorosai/dbgpt-docs:${{ github.event_name == 'workflow_dispatch' && inputs.branch || github. ref_name }},eosphorosai/dbgpt-docs:latest
Original file line number Diff line number Diff line change @@ -25,7 +25,13 @@ COPY . /app
2525
2626# Make sure we have the latest version of the repository
2727RUN if [ "$CI" = "true" ]; then \
28- git fetch --prune --unshallow; \
28+ # Check if the repo is shallow before trying to unshallow it
29+ if git rev-parse --is-shallow-repository | grep -q 'true'; then \
30+ git fetch --prune --unshallow; \
31+ else \
32+ echo "Repository is already complete, skipping unshallow"; \
33+ git fetch --prune; \
34+ fi; \
2935 fi
3036
3137ARG NUM_VERSION=2
You can’t perform that action at this time.
0 commit comments