File tree Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Expand file tree Collapse file tree 1 file changed +17
-8
lines changed Original file line number Diff line number Diff line change 33 push :
44 tags :
55 - v*
6- workflow_dispatch :
7- inputs :
8- version :
9- description : CNI network pluging version
10- required : true
116jobs :
12- push-amd64 :
13- name : Image push/amd64
7+ push-image :
8+ name : Image build and push
149 runs-on : ubuntu-latest
1510 steps :
1611 - name : Check out code into the Go module directory
3934 flavor : |
4035 latest=false
4136
37+ - name : Discover CNI plugins version
38+ run : |
39+ echo "CNI_VERSION=$(echo ${{ github.ref_name }} | awk '{gsub(/-update.*$/,"")}1')" >> $GITHUB_ENV
40+
41+ - name : Validate CNI version
42+ run : |
43+ if [[ "${{ env.CNI_VERSION }}" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)?$ ]]; then
44+ echo "Valid CNI Version"
45+ else
46+ echo "Invalid CNI version/tag provided"
47+ exit 1
48+ fi
4249 - name : Build and push container image
4350 uses : docker/build-push-action@v4
4451 with :
4754 "github_token=${{ secrets.GITHUB_TOKEN }}"
4855 platforms : linux/amd64,linux/arm64
4956 push : true
57+ build-args : |
58+ VERSION=${{ env.CNI_VERSION }}
5059 tags : |
51- ghcr.io/k8snetworkplumbingwg/plugins:${{ github.event.inputs.version }}
60+ ghcr.io/k8snetworkplumbingwg/plugins:${{ github.ref_name }}
5261 file : ./Dockerfile
You can’t perform that action at this time.
0 commit comments