Skip to content

Commit c558692

Browse files
authored
[Bugfix] Fix docker build problem in github workflow (#164)
* Fix problem in Github workflow * [Add] manual trigger for github action Signed-off-by: ApostaC <[email protected]>
1 parent 1934390 commit c558692

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

.github/workflows/router-docker-release.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
- 'docker/**'
1010
- 'setup.py'
1111

12+
workflow_dispatch:
13+
1214
jobs:
1315
release:
1416
permissions:
@@ -24,25 +26,42 @@ jobs:
2426
- name: Set up Docker Buildx
2527
uses: docker/setup-buildx-action@v3
2628

27-
- name: Login to Container Registry
29+
# Login to GitHub Container Registry (GHCR)
30+
- name: Login to GHCR
2831
uses: docker/login-action@v3
2932
with:
3033
registry: ghcr.io
3134
username: ${{ github.actor }}
3235
password: ${{ secrets.GITHUB_TOKEN }}
3336

34-
- name: Extract version
37+
# Login to Docker Hub
38+
- name: Login to Docker Hub
39+
uses: docker/login-action@v3
40+
with:
41+
registry: docker.io
42+
username: lmcache
43+
password: ${{ secrets.LMCACHE_DOCKER_SECRET }}
44+
45+
- name: Extract and sanitize version
3546
id: version
36-
run: echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT"
47+
run: |
48+
raw_version=$(python setup.py --version)
49+
sanitized_version=${raw_version//+/-}
50+
echo "version=$sanitized_version" >> "$GITHUB_ENV"
51+
echo "Sanitized version: $sanitized_version"
52+
3753
- name: Build and push image
3854
uses: docker/build-push-action@v5
3955
with:
4056
context: .
4157
file: docker/Dockerfile
4258
push: true
59+
# Note: also push the image to Docker Hub as the helm chart uses it by default
4360
tags: |
4461
ghcr.io/${{ github.repository }}/router:latest
45-
ghcr.io/${{ github.repository }}/router:${{ steps.version.outputs.version }}
62+
ghcr.io/${{ github.repository }}/router:${{ env.version }}
4663
ghcr.io/${{ github.repository }}/router:${{ github.sha }}
64+
lmcache/lmstack-router:latest
65+
lmcache/lmstack-router:${{ env.version }}
4766
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/router:buildcache
4867
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}/router:buildcache,mode=max

0 commit comments

Comments
 (0)