11name : Image Build
22
33on :
4+ workflow_dispatch :
45 push :
56 branches :
67 - ' **'
78 tags :
89 - ' v*.*.*'
9- pull_request :
10- branches :
11- - ' master'
12- - ' dev'
1310
1411jobs :
1512 Build :
1815 - uses : actions/checkout@v4
1916 - name : Docker meta for KubeSphere
2017 id : meta
21- if : github.repository_owner == 'kubesphere'
2218 uses : docker/metadata-action@v3
2319 with :
2420 images : |
@@ -34,28 +30,24 @@ jobs:
3430 - name : Set up Docker Buildx
3531 uses : docker/setup-buildx-action@v1
3632 - name : Login to DockerHub
37- if : github.event_name != 'pull_request'
3833 uses : docker/login-action@v1
3934 with :
4035 username : ${{ secrets.DOCKER_HUB_USER }}
4136 password : ${{ secrets.DOCKER_HUB_SECRETS }}
4237 - name : Build env
4338 id : build_env
4439 run : |
45- if [ " ${{ github.event_name }}" == "pull_request " ]
40+ if [ ${{ github.ref_type }} == "tag " ]
4641 then
47- echo "::set-output name=platforms::linux/amd64"
48- echo "::set-output name=push::false"
49- echo "::set-output name=load::true"
50- else
5142 echo "::set-output name=platforms::linux/amd64,linux/arm64"
52- echo "::set-output name=push::true"
53- echo "::set-output name=load::false "
43+ else
44+ echo "::set-output name=platforms::linux/amd64 "
5445 fi
46+ echo "::set-output name=push::true"
47+ echo "::set-output name=load::false"
5548 echo "::set-output name=short_sha::${GITHUB_SHA::7}"
5649 - name : Build and push Docker images
575058- if : github.repository_owner == 'kubesphere'
5951 with :
6052 context : .
6153 file : Dockerfile
0 commit comments