1+ # Copyright (c) 2025 Beijing Volcano Engine Technology Co., Ltd. and/or its affiliates.
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ name : Push Stable Image to Volcengine Container Registry
16+
17+ on :
18+ push :
19+ # Trigger only when creating tags
20+ tags :
21+ - ' *'
22+ workflow_dispatch :
23+
24+ jobs :
25+ build-and-push :
26+ runs-on : ubuntu-latest
27+ permissions :
28+ contents : read
29+
30+ # To avoid forked repo execute this workflow
31+ if : github.repository == 'volcengine/veadk-python'
32+
33+ # Set global environments
34+ env :
35+ CR_URL : veadk-cn-beijing.cr.volces.com
36+ CR_NAMESPACE : veadk
37+ CR_REPO : veadk-python
38+ DOCKERFILE : docker/Dockerfile.stable
39+
40+ steps :
41+ - name : Checkout code
42+ uses : actions/checkout@v4
43+ with :
44+ fetch-depth : 0
45+
46+ - name : Set up Docker Buildx
47+ uses : docker/setup-buildx-action@v3
48+
49+ - name : Login to Volcengine Container Registry
50+ run : |
51+ echo "${{ secrets.VE_CR_PASSWORD }}" | \
52+ docker login veadk-cn-beijing.cr.volces.com \
53+ -u "${{ secrets.VE_CR_USERNAME }}" \
54+ --password-stdin
55+
56+ # Specify a platform, as VeFaaS required `linux/amd64`
57+ # push 2 tags (x.x.x and latest) in one push
58+ - name : Build and push
59+ run : |
60+ LATEST_TAG=$CR_URL/$CR_NAMESPACE/$CR_REPO:latest
61+ VERSION_TAG=$CR_URL/$CR_NAMESPACE/$CR_REPO:$GITHUB_REF_NAME
62+ docker buildx build \
63+ --file $DOCKERFILE \
64+ --tag $VERSION_TAG \
65+ --tag $LATEST_TAG \
66+ --platform linux/amd64 \
67+ --push \
68+ --cache-from=type=gha \
69+ --cache-to=type=gha,mode=max \
70+ .
0 commit comments