Skip to content

Commit 4c9e86c

Browse files
authored
manually build dev image instead of publishing it every version (#4409)
* manually build dev image * fix according to copilot
1 parent 17ed9e5 commit 4c9e86c

2 files changed

Lines changed: 55 additions & 47 deletions

File tree

.github/workflows/docker.yml

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
TAG: "openmmlab/lmdeploy:latest-${{matrix.cuda_version}}"
4646
steps:
4747
- name: Checkout repository
48-
uses: actions/checkout@v3
48+
uses: actions/checkout@v4
4949
with:
5050
ref: ${{github.event.inputs.repo_ref}}
5151
- name: Free disk space
@@ -96,51 +96,6 @@ jobs:
9696
docker tag $TAG $RELEASE_TAG
9797
docker push $RELEASE_TAG
9898
99-
publish_dev_docker_image:
100-
runs-on: ubuntu-latest
101-
environment: 'prod'
102-
env:
103-
TAG_PREFIX: "openmmlab/lmdeploy"
104-
TAG: "openmmlab/lmdeploy:dev"
105-
steps:
106-
- name: Checkout repository
107-
uses: actions/checkout@v3
108-
with:
109-
ref: ${{github.event.inputs.repo_ref}}
110-
- name: Free disk space
111-
uses: jlumbroso/free-disk-space@main
112-
with:
113-
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
114-
tool-cache: false
115-
docker-images: false
116-
# All of these default to true, but feel free to set to "false" if necessary for your workflow
117-
android: true
118-
dotnet: true
119-
haskell: true
120-
large-packages: true
121-
swap-storage: false
122-
- name: Get docker info
123-
run: |
124-
docker info
125-
# remove http extraheader
126-
git config --local --unset "http.https://github.com/.extraheader"
127-
- name: Login to Docker Hub
128-
uses: docker/login-action@v2
129-
with:
130-
username: ${{ secrets.DOCKERHUB_USERNAME }}
131-
password: ${{ secrets.DOCKERHUB_TOKEN }}
132-
- name: Update docker TAG from workflow input
133-
if: github.event_name == 'workflow_dispatch'
134-
run: |
135-
export TAG=$TAG_PREFIX:${{github.event.inputs.image_tag}}-dev
136-
echo $TAG
137-
echo "TAG=${TAG}" >> $GITHUB_ENV
138-
- name: Build and push Docker image
139-
run: |
140-
echo $TAG
141-
docker build . -f docker/Dockerfile -t ${TAG} --build-arg IMAGE_TYPE=dev
142-
docker push $TAG
143-
14499
publish_ascend_docker_image:
145100
runs-on: ubuntu-latest
146101
environment: 'prod'
@@ -149,7 +104,7 @@ jobs:
149104
TAG: "openmmlab/lmdeploy:ascend"
150105
steps:
151106
- name: Checkout repository
152-
uses: actions/checkout@v3
107+
uses: actions/checkout@v4
153108
with:
154109
ref: ${{github.event.inputs.repo_ref}}
155110
- name: Free disk space

.github/workflows/docker_dev.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: publish-dev-docker
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
repo_ref:
7+
required: false
8+
description: 'Set branch or tag or commit id. Default is "main"'
9+
type: string
10+
default: 'main'
11+
12+
jobs:
13+
publish_dev_docker_image:
14+
runs-on: ubuntu-latest
15+
environment: 'prod'
16+
env:
17+
TAG: "openmmlab/lmdeploy:dev-cu12.8"
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ github.event.inputs.repo_ref }}
23+
24+
- name: Free disk space
25+
uses: jlumbroso/free-disk-space@v1.3.1
26+
with:
27+
# This might remove tools that are actually needed, if set to "true" but frees about 6 GB
28+
tool-cache: false
29+
docker-images: false
30+
# All of these default to true, but feel free to set to "false" if necessary for your workflow
31+
android: true
32+
dotnet: true
33+
haskell: true
34+
large-packages: true
35+
swap-storage: false
36+
37+
- name: Get docker info
38+
run: |
39+
docker info
40+
# remove http extraheader
41+
git config --local --unset "http.https://github.com/.extraheader"
42+
43+
- name: Login to Docker Hub
44+
uses: docker/login-action@v2
45+
with:
46+
username: ${{ secrets.DOCKERHUB_USERNAME }}
47+
password: ${{ secrets.DOCKERHUB_TOKEN }}
48+
49+
- name: Build and push Docker image
50+
run: |
51+
echo $TAG
52+
docker build . -f docker/Dockerfile_dev -t ${TAG}
53+
docker push $TAG

0 commit comments

Comments
 (0)