44 push :
55 branches :
66 - master
7- - dev
87
98env :
109 REGISTRY_IMAGE : moosefs/moosefs-csi
11- MFS_CLIENT : 4.57.7
10+ MFS_CLIENT : 4.58.0
1211 CSI_VERSION : 0.9.8
1312
1413jobs :
15- build :
14+ build-dockerhub :
1615 runs-on : ubuntu-latest
17- strategy :
18- fail-fast : false
19- matrix :
20- platform :
21- - linux/amd64
22- - linux/arm64
23- - linux/arm/v7
2416 steps :
25- - name : Prepare
26- run : |
27- platform=${{ matrix.platform }}
28- echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
29-
30- - name : Docker meta
31- id : meta
32- uses : docker/metadata-action@v5
33- with :
34- images : ${{ env.REGISTRY_IMAGE }}
35- tags : |
36- type=ref,event=branch
37- type=raw,value=${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
38- type=raw,value=${{ env.CSI_VERSION }}-{{branch}}
39-
17+ - name : Checkout
18+ uses : actions/checkout@v4
4019 - name : Set up QEMU
4120 uses : docker/setup-qemu-action@v3
42-
4321 - name : Set up Docker Buildx
4422 uses : docker/setup-buildx-action@v3
45-
46- - name : Login to GitHub Container Registry
23+ - name : Login to Docker Hub
4724 uses : docker/login-action@v3
4825 with :
49- registry : ghcr.io
50- username : ${{ github.actor }}
51- password : ${{ secrets.GHCR_TOKEN }}
52-
53- - name : Build and push by digest MooseFS Client v4
54- id : build
55- uses : docker/build-push-action@v6
56- with :
57- file : ./cmd/moosefs-csi-plugin/Dockerfile
58- platforms : ${{ matrix.platform }}
59- labels : ${{ steps.meta.outputs.labels }}
60- outputs : type=image,name=ghcr.io/${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
61- build-args : |
62- MFS_TAG=v${{ env.MFS_CLIENT }}
63- CSI_TAG=dev
64-
65- - name : Export digest
66- run : |
67- mkdir -p /tmp/digests
68- digest="${{ steps.build.outputs.digest }}"
69- touch "/tmp/digests/${digest#sha256:}"
70-
71- - name : Upload digest
72- uses : actions/upload-artifact@v4
26+ username : ${{ secrets.DOCKERHUB_USERNAME }}
27+ password : ${{ secrets.DOCKERHUB_TOKEN }}
28+ - name : Build and push
29+ uses : docker/build-push-action@v5
7330 with :
74- name : digests-${{ env.PLATFORM_PAIR }}
75- path : /tmp/digests/*
76- if-no-files-found : error
77- retention-days : 1
78-
79- merge :
31+ context : ./cmd/moosefs-csi-plugin
32+ platforms : linux/amd64,linux/arm64,linux/arm/v7
33+ push : true
34+ tags : |
35+ ${{ env.REGISTRY_IMAGE }}:${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
36+ ${{ env.REGISTRY_IMAGE }}:latest
37+ build-ghcr :
8038 runs-on : ubuntu-latest
81- needs :
82- - build
8339 steps :
84- - name : Download digests
85- uses : actions/download-artifact@v4
86- with :
87- path : /tmp/digests
88- pattern : digests-*
89- merge-multiple : true
90-
40+ - name : Checkout
41+ uses : actions/checkout@v4
42+ - name : Set up QEMU
43+ uses : docker/setup-qemu-action@v3
9144 - name : Set up Docker Buildx
9245 uses : docker/setup-buildx-action@v3
93-
94- - name : Docker meta
95- id : meta
96- uses : docker/metadata-action@v5
97- with :
98- images : ghcr.io/${{ env.REGISTRY_IMAGE }}
99- tags : |
100- type=ref,event=branch
101- type=raw,value=${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
102- type=raw,value=${{ env.CSI_VERSION }}-{{branch}}
103-
10446 - name : Login to GitHub Container Registry
10547 uses : docker/login-action@v3
10648 with :
10749 registry : ghcr.io
10850 username : ${{ github.actor }}
10951 password : ${{ secrets.GHCR_TOKEN }}
110-
111- - name : Create manifest list and push
112- working-directory : /tmp/digests
113- run : |
114- docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
115- $(printf 'ghcr.io/${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
116-
117- - name : Inspect image
118- run : |
119- docker buildx imagetools inspect ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
52+ - name : Build and push
53+ uses : docker/build- push-action@v5
54+ with :
55+ context : ./cmd/moosefs-csi-plugin
56+ platforms : linux/amd64,linux/arm64,linux/arm/v7
57+ push : true
58+ tags : |
59+ ${{ env.REGISTRY_IMAGE }}:${{ env.CSI_VERSION }}-${{ env.MFS_CLIENT }}
60+ ${{ env.REGISTRY_IMAGE }}:latest
61+
0 commit comments