Skip to content

Commit a0f8aff

Browse files
committed
chore: mirror registry workflow
1 parent 8eb63bd commit a0f8aff

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

.github/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM python:3.12-slim
2+
3+
# # Install git and install veadk-python via git
4+
RUN apt-get update && apt-get install -y git && \
5+
pip3 install --no-cache-dir git+https://github.com/volcengine/veadk-python.git && \
6+
apt-get clean && rm -rf /var/lib/apt/lists/*
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Mirror to Registry
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
# This job is executed only when the repository is the main repository.
12+
if: github.repository == 'zakahan/veadk-python'
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: Login to Volcengine Container Registry
23+
uses: docker/login-action@v3
24+
with:
25+
registry: test-veadk-cn-beijing.cr.volces.com
26+
username: ${{ secrets.REGISTRY_USERNAME }}
27+
password: ${{ secrets.REGISTRY_PASSWORD }}
28+
29+
- name: Extract metadata
30+
id: meta
31+
uses: docker/metadata-action@v5
32+
with:
33+
images: test-veadk-cn-beijing.cr.volces.com/veadk/veadk-python312
34+
tags: |
35+
type=sha,format=short
36+
type=ref,event=branch
37+
latest
38+
39+
- name: Build and push
40+
uses: docker/build-push-action@v5
41+
with:
42+
context: .
43+
file: .github/Dockerfile
44+
push: true
45+
tags: ${{ steps.meta.outputs.tags }}
46+
labels: ${{ steps.meta.outputs.labels }}
47+
cache-from: type=gha
48+
cache-to: type=gha,mode=max

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,7 @@ cython_debug/
185185
**/node_modules/
186186

187187
# 忽略所有 .temp 目录
188-
**/.temp/
188+
**/.temp/
189+
190+
# secrets
191+
.secrets

0 commit comments

Comments
 (0)