Skip to content

Commit 338cb09

Browse files
committed
ci: add publish to ECR step
1 parent 3390e1e commit 338cb09

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/docker.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222

2323
env:
2424
IMAGE_NAME: atlantis-prime-pipeline
25+
IMAGE_REPO: 579478677147.dkr.ecr.eu-central-1.amazonaws.com/dataplatform/compass/atlantis-prime-pipeline
2526

2627
jobs:
2728
test:
@@ -59,3 +60,25 @@ jobs:
5960
image: localbuild/testimage:latest
6061
artifact-name: sbom.spdx
6162
if: github.event_name == 'release'
63+
publish:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: Build Docker image locally
68+
run: |
69+
if [ -f docker-compose.test.yml ]; then
70+
docker-compose --file docker-compose.test.yml build
71+
docker-compose --file docker-compose.test.yml run sut
72+
else
73+
docker build . --file Dockerfile --tag ${{ env.IMAGE_REPO }}:latest
74+
fi
75+
- name: Configure AWS Credentials
76+
uses: aws-actions/configure-aws-credentials@v4.1.0
77+
with:
78+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
79+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
80+
aws-region: eu-central-1
81+
- run: |
82+
aws ecr get-login-password --region eu-central-1 | docker login 579478677147.dkr.ecr.eu-central-1.amazonaws.com --username AWS --password-stdin
83+
- run: |
84+
docker push ${{ env.IMAGE_REPO }}:latest

0 commit comments

Comments
 (0)