File tree Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Expand file tree Collapse file tree 1 file changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release image build
2+
3+ on :
4+ # Trigger on workflow_dispatch (manual trigger)
5+ workflow_dispatch :
6+ inputs :
7+ tag :
8+ description : ' Tag to build (e.g., v1.0.0)'
9+ required : false
10+ # Trigger on push for new tags
11+ push :
12+ tags :
13+ - ' *'
14+
15+ jobs :
16+ image-publish :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Set tag from inputs or Git tag
20+ id : set-tag
21+ run : |
22+ if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
23+ echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
24+ elif [ "${{ github.event_name }}" == "push" ]; then
25+ echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
26+ else
27+ echo "No valid trigger for building an image."
28+ exit 1
29+ fi
30+ shell : bash
31+
32+ - uses : actions/checkout@v4
33+ with :
34+ submodules : true
35+
36+ - uses : actions/setup-go@v5
37+ with :
38+ go-version : ' 1.23'
39+ cache : false
40+
41+ - name : Config env
42+ run : |
43+ echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_AK }}" >> $GITHUB_ENV
44+ echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SK }}" >> $GITHUB_ENV
45+ echo "AWS_DEFAULT_REGION=us-east-2" >> $GITHUB_ENV
46+
47+ - name : AWS CLI Init
48+ uses : unfor19/install-aws-cli-action@v1
49+
50+ - name : Config ECR
51+ run : |
52+ aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/cloudpilotai
53+
54+ - uses : ko-build/setup-ko@v0.6
55+
56+ - name : Build and publish image
57+ run : |
58+ export KO_DOCKER_REPO=public.ecr.aws/cloudpilotai/alibabacloud/karpenter
59+ export IMAGE_TAG=${{ env.tag }}
60+ ko build --bare github.com/cloudpilot-ai/karpenter-provider-alibabacloud/cmd/controller -t $IMAGE_TAG
You can’t perform that action at this time.
0 commit comments