Skip to content

Commit c1847aa

Browse files
committed
test
1 parent 24bc014 commit c1847aa

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

.github/actions/container-build-push/action.yaml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,6 @@ runs:
9191
aws-access-key-id: ${{ env.AWS_ACCESS_KEY }}
9292
aws-secret-access-key: ${{ env.AWS_SECRET_KEY }}
9393
aws-region: ${{ inputs.aws-region }}
94-
- name: Set up QEMU
95-
uses: docker/setup-qemu-action@v3
96-
with:
97-
platforms: ${{ inputs.platforms }}
98-
- name: Set up Docker Buildx
99-
uses: docker/setup-buildx-action@v3
10094
- name: Expand tags with ECR url and ECR repo
10195
id: expand_tags
10296
env:
@@ -114,19 +108,33 @@ runs:
114108
echo EOF
115109
} >> "$GITHUB_ENV"
116110
echo "REPO=$REPO" >> "$GITHUB_ENV"
117-
- name: Build and push Docker images
118-
uses: docker/build-push-action@v6
119-
id: build_push
120-
with:
121-
file: ${{ inputs.container-file }}
122-
context: ${{ inputs.build-context }}
123-
push: ${{ inputs.push-image }}
124-
tags: ${{ env.EXPANDED_TAGS }}
125-
build-args: ${{ inputs.build-args }}
126-
platforms: ${{ inputs.platforms }}
127-
cache-from: type=registry,ref=${{ inputs.ecr-url }}/${{ env.REPO }}:buildcache
128-
cache-to: mode=max,image-manifest=true,oci-mediatypes=true,type=registry,ref=${{ inputs.ecr-url }}/${{ env.REPO }}:buildcache
129-
labels: ${{ inputs.labels }}
130-
secrets: ${{ inputs.secrets }}
131-
secret-envs: ${{ inputs.secret-envs }}
132-
provenance: ${{ inputs.provenance }}
111+
112+
- name: Build and push Docker images (legacy)
113+
shell: bash
114+
env:
115+
CONTAINERFILE: ${{ inputs.container-file }}
116+
BUILD_CONTEXT: ${{ inputs.build-context }}
117+
BUILD_ARGS: ${{ inputs.build-args }}
118+
ECR_URL: ${{ inputs.ecr-url }}
119+
AWS_REGION: ${{ inputs.aws-region }}
120+
run: |
121+
# Login to ECR
122+
aws ecr get-login-password --region $AWS_REGION | \
123+
docker login --username AWS --password-stdin $ECR_URL
124+
125+
# Parse build args
126+
DOCKER_BUILD_ARGS=""
127+
if [ -n "$BUILD_ARGS" ]; then
128+
while IFS= read -r arg; do
129+
[ -n "$arg" ] && DOCKER_BUILD_ARGS="$DOCKER_BUILD_ARGS --build-arg $arg"
130+
done <<< "$BUILD_ARGS"
131+
fi
132+
133+
# Build and push each tag
134+
for TAG in $EXPANDED_TAGS; do
135+
docker build -f $CONTAINERFILE \
136+
$DOCKER_BUILD_ARGS \
137+
-t $TAG \
138+
$BUILD_CONTEXT
139+
docker push $TAG
140+
done

.github/workflows/lcm-pipeline.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ jobs:
136136
aws-creds-vault-role: ${{ inputs.deploy && 'ecr-ii-push' || 'ecr-push-testing' }}
137137
aws-creds-vault-path: "secret/data/v3/int/ecr/infra1-user-ecr-rw${{ !inputs.deploy && '-testing' || '' }}"
138138
build-tags: |
139-
latest
140139
${{ needs.prepare-build.outputs.image_tag }}
141-
${{ needs.prepare-build.outputs.service_version }}
142-
${{ needs.prepare-build.outputs.service_major_version }}
143140
build-context: ${{ steps.load-config.outputs.CONTAINER_CONTEXT }}
144141
container-file: ${{ steps.get-image-config.outputs.CONTAINER_FILE }}
145142
vault-url: '${{ secrets.VAULT_ADDRESS }}'

0 commit comments

Comments
 (0)