Skip to content

Commit e37583a

Browse files
add build action
Signed-off-by: stoneshi-yunify <[email protected]>
1 parent 829d21d commit e37583a

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed

.github/workflows/build.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "Image Tag"
8+
default: "latest"
9+
push:
10+
branches:
11+
- 'main'
12+
- 'release-*'
13+
tags:
14+
- 'v*'
15+
16+
jobs:
17+
buildx:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Prepare
24+
id: prepare
25+
run: |
26+
VERSION=latest
27+
if [[ $GITHUB_REF == refs/tags/* ]]; then
28+
VERSION=${GITHUB_REF#refs/tags/}
29+
fi
30+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
31+
VERSION=${{ github.event.inputs.tag }}
32+
fi
33+
echo ::set-output name=version::${VERSION}
34+
35+
- name: Docker meta for kubesphere
36+
id: meta
37+
uses: docker/metadata-action@v3
38+
with:
39+
images: docker.io/kubesphere/volume-initializer
40+
tags: ${{ steps.prepare.outputs.version }}
41+
42+
- name: Set up QEMU
43+
uses: docker/setup-qemu-action@v1
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v1
46+
- name: Login to DockerHub
47+
if: github.event_name != 'pull_request'
48+
uses: docker/login-action@v1
49+
with:
50+
registry: docker.io
51+
username: ${{ secrets.DOCKERHUB_USERNAME }}
52+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
53+
54+
- name: Build and push Docker images
55+
uses: docker/[email protected]
56+
with:
57+
context: .
58+
file: ./Dockerfile
59+
tags: ${{ steps.meta.outputs.tags }}
60+
push: true
61+
load: false
62+
labels: ${{ steps.meta.outputs.labels }}
63+
platforms: linux/amd64,linux/arm64

config/samples/mongo-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ spec:
1717
spec:
1818
containers:
1919
- name: container-tle280
20-
image: 'registry.cn-hangzhou.aliyuncs.com/stoneshiyunify/mongodb:4.2.4-debian-10-r0'
20+
image: 'bitnami/mongodb:4.2.4-debian-10-r0'
2121
ports:
2222
- name: http-27017
2323
containerPort: 27017

deploy/webhook-deployment-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ spec:
9090
spec:
9191
containers:
9292
- name: volume-initializer
93-
image: registry.cn-hangzhou.aliyuncs.com/stoneshiyunify/volume-initializer:latest
93+
image: kubesphere/volume-initializer:latest
9494
imagePullPolicy: Always
9595
args: ['--tls-cert-file=/etc/run/certs/tls.crt', '--tls-private-key-file=/etc/run/certs/tls.key']
9696
ports:

deploy/webhook-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ spec:
9090
spec:
9191
containers:
9292
- name: volume-initializer
93-
image: registry.cn-hangzhou.aliyuncs.com/stoneshiyunify/volume-initializer:latest
93+
image: kubesphere/volume-initializer:latest
9494
imagePullPolicy: Always
9595
args: ['--tls-cert-file=/etc/run/certs/tls.crt', '--tls-private-key-file=/etc/run/certs/tls.key']
9696
ports:

0 commit comments

Comments
 (0)