Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Commit e23a202

Browse files
authored
Merge pull request #11 from docker/ci/adopt-build-push-image-ecr
ci: adopt docker/actions/build-push-image-ecr
2 parents 6d30aa7 + f72aa58 commit e23a202

1 file changed

Lines changed: 14 additions & 40 deletions

File tree

.github/workflows/build-and-release.yaml

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,26 @@ permissions:
1212
jobs:
1313
build-and-push:
1414
runs-on: ubuntu-latest
15-
15+
1616
steps:
1717
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1818
with:
1919
fetch-depth: 0
2020

21-
- name: Login to Docker Hub
22-
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
23-
with:
24-
# Stopgap: DOCKERBUILDBOT_READ_PAT is not yet shared with docker/envoy.
25-
# dockerpublicbot's read PAT is already available as an org secret here.
26-
# Revert to dockerbuildbot once the org secret access is granted.
27-
username: dockerpublicbot
28-
password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}
29-
30-
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
32-
with:
33-
driver: cloud
34-
endpoint: docker/platform-experience
35-
install: true
36-
37-
- name: Configure AWS Credentials
38-
uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0
39-
with:
40-
role-to-assume: "arn:aws:iam::710015040892:role/CicdEnvoy-20251021161123163100000002"
41-
role-session-name: EnvoyCI
42-
aws-region: us-east-1
43-
44-
- name: Login to ECR
21+
- name: Compute image version
22+
id: version
4523
run: |
46-
aws ecr get-login-password | docker login --username AWS --password-stdin 710015040892.dkr.ecr.us-east-1.amazonaws.com
24+
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
25+
echo "version=1.38.2-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
4726
48-
- name: Get Current Git SHA
49-
id: git_sha
50-
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
51-
52-
- name: Build and Push Docker Image
53-
id: docker-build
54-
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
27+
- name: Build and push to ECR
28+
uses: docker/actions/build-push-image-ecr@b23a287c41a8de3106eaf4ed333465a62dc1a9f7 # main
5529
with:
56-
context: .
30+
image_name: envoy
31+
image_version: ${{ steps.version.outputs.version }}
32+
target: envoy-distroless
5733
platforms: linux/amd64
58-
# push: true
59-
build-args: |
60-
VERSION=${{ steps.git_sha.outputs.sha }}
61-
tags: |
62-
710015040892.dkr.ecr.us-east-1.amazonaws.com/infra-routing/envoy:${{ steps.git_sha.outputs.sha }}
63-
34+
build_args: |
35+
VERSION=${{ steps.version.outputs.sha }}
36+
docker_username: dockerpublicbot
37+
docker_password: ${{ secrets.DOCKERPUBLICBOT_READ_PAT }}

0 commit comments

Comments
 (0)