Skip to content

Commit e954868

Browse files
committed
添加github cicd
1 parent b7299c8 commit e954868

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.drone.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ clone:
77

88
trigger:
99
ref:
10-
- refs/tags/v*
10+
- refs/tags/ee*
1111

1212
steps: # 定义流水线执行步骤,这些步骤将顺序执行
1313
- name: clone

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "v*"
8+
9+
env:
10+
DOCKERHUB_REPO: dataelement/
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build_bisheng_ft_arm:
18+
name: Build bisheng-ft ARM Docker Image
19+
runs-on: ubuntu-22.04-arm
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v3
23+
24+
- name: Set up QEMU
25+
uses: docker/setup-qemu-action@v2
26+
with:
27+
platforms: arm64
28+
29+
- name: Login to DockerHub
30+
uses: docker/login-action@v2
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
35+
- name: Get the version tag
36+
id: get_version
37+
run: |
38+
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
39+
echo "Version: ${{ env.VERSION }}"
40+
41+
- name: cd to docker directory
42+
run: cd docker/docker-npu/
43+
44+
- name: Build Docker image
45+
run: |
46+
docker build --platform linux/arm64 --tag ${{ env.DOCKERHUB_REPO }}bisheng-ft-npu:${{ env.VERSION }}-arm64 --file ./Dockerfile ../..
47+
48+
- name: Push Docker image
49+
run: |
50+
docker push ${{ env.DOCKERHUB_REPO }}bisheng-ft-npu:${{ env.VERSION }}-arm64
51+
docker tag ${{ env.DOCKERHUB_REPO }}bisheng-ft-npu:${{ env.VERSION }}-arm64 ${{ env.DOCKERHUB_REPO }}bisheng-ft-npu:latest-arm64
52+
docker images | grep bisheng-ft-npu
53+
docker push ${{ env.DOCKERHUB_REPO }}bisheng-ft-npu:latest-arm64

0 commit comments

Comments
 (0)