-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (30 loc) · 1.16 KB
/
docker_push.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Docker push
permissions:
contents: read
id-token: write
on:
push:
branches:
- main
- add-curl-check-before-pushing-image # to be cleaned up before merging
jobs:
docker_push:
runs-on: ubuntu-latest
steps:
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v 4.0.1
with:
role-to-assume: ${{ secrets.iam_role }}
role-session-name: docker_build_public
aws-region: us-east-1
- uses: actions/checkout@v4
- run: |
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/doctolib
cd neurow
docker buildx build . --build-arg GIT_COMMIT_SHA1=${{ github.event.pull_request.head.sha || github.event.after || github.sha }} --load -t neurow:test
docker run -d --name neurow_test neurow:test
sleep 5
# Check if API is responding to requests
# Push if responding, exit with error otherwise
docker stop neurow_test
docker rm neurow_test