11name : ' Agents Production Deployment'
2- description : ' Promote staging agent image to production feed'
2+ description : ' Promote staging agent image to enterprise feed in GHCR '
33
44inputs :
55 image_repository :
@@ -15,26 +15,10 @@ inputs:
1515 github_token :
1616 description : ' GitHub token for GHCR access'
1717 required : true
18- harbor_registry :
19- description : ' Harbor registry URL'
20- required : true
21- harbor_username :
22- description : ' Harbor username'
23- required : true
24- harbor_password :
25- description : ' Harbor password'
26- required : true
2718
2819runs :
2920 using : " composite"
3021 steps :
31- - name : Extract service name for Harbor
32- shell : bash
33- id : service
34- run : |
35- SERVICE_NAME=$(echo "${{ inputs.image_repository }}" | cut -d'/' -f2)
36- echo "service_name=$SERVICE_NAME" >> $GITHUB_OUTPUT
37-
3822 - name : Login to GitHub Container Registry
3923 uses : docker/login-action@v3
4024 with :
@@ -46,20 +30,16 @@ runs:
4630 shell : bash
4731 run : |
4832 STAGING_IMAGE="ghcr.io/${{ inputs.image_repository }}:${{ inputs.staging_version }}-staging"
49-
5033 if ! docker manifest inspect "$STAGING_IMAGE" > /dev/null 2>&1; then
5134 echo "Error: Staging image not found: $STAGING_IMAGE"
5235 exit 1
5336 fi
54-
5537 echo "Staging image verified: $STAGING_IMAGE"
56-
5738 if [ "${{ inputs.dry_run }}" = "true" ]; then
5839 echo "DRY RUN MODE - Skipping pull"
5940 else
6041 docker pull $STAGING_IMAGE
6142 fi
62-
6343 echo "STAGING_IMAGE=$STAGING_IMAGE" >> $GITHUB_ENV
6444
6545 - name : Tag and push to GHCR production
8161 echo " - ghcr.io/${{ inputs.image_repository }}:${{ inputs.staging_version }}"
8262 echo " - ghcr.io/${{ inputs.image_repository }}:enterprise"
8363 echo " - ghcr.io/${{ inputs.image_repository }}:latest"
84-
85- - name : Login to Harbor
86- if : inputs.dry_run != 'true'
87- uses : docker/login-action@v3
88- with :
89- registry : ${{ inputs.harbor_registry }}
90- username : ${{ inputs.harbor_username }}
91- password : ${{ inputs.harbor_password }}
92-
93- - name : Tag and push to Harbor
94- if : inputs.dry_run != 'true'
95- shell : bash
96- run : |
97- HARBOR_IMAGE="${{ inputs.harbor_registry }}/community/${{ steps.service.outputs.service_name }}"
98- docker tag $STAGING_IMAGE ${HARBOR_IMAGE}:${{ inputs.staging_version }}
99- docker tag $STAGING_IMAGE ${HARBOR_IMAGE}:community
100- docker tag $STAGING_IMAGE ${HARBOR_IMAGE}:latest
101- docker push ${HARBOR_IMAGE}:${{ inputs.staging_version }}
102- docker push ${HARBOR_IMAGE}:community
103- docker push ${HARBOR_IMAGE}:latest
104-
105- - name : Dry run summary for Harbor
106- if : inputs.dry_run == 'true'
107- shell : bash
108- run : |
109- echo "DRY RUN - Would push to Harbor:"
110- echo " - ${{ inputs.harbor_registry }}/community/${{ steps.service.outputs.service_name }}:${{ inputs.staging_version }}"
111- echo " - ${{ inputs.harbor_registry }}/community/${{ steps.service.outputs.service_name }}:community"
112- echo " - ${{ inputs.harbor_registry }}/community/${{ steps.service.outputs.service_name }}:latest"
0 commit comments