File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ name: Build, test and deploy
22
33on :
44 push :
5- branches : [ main ]
5+ branches : [main]
66 pull_request :
7- branches : [ main ]
7+ branches : [main]
88
99jobs :
10- build :
10+ test :
1111 runs-on : ubuntu-latest
1212 permissions :
1313 id-token : write # Needed for OIDC login
@@ -27,19 +27,28 @@ jobs:
2727 - name : Run tests
2828 run : uv run pytest
2929
30+ docker :
31+ runs-on : ubuntu-latest
32+ if : github.ref == 'refs/heads/main'
33+ needs : [test]
34+ permissions :
35+ id-token : write # Needed for OIDC login
36+ steps :
37+ - uses : actions/checkout@v4
38+
3039 - name : Configure AWS credentials
3140 uses : aws-actions/configure-aws-credentials@v4
3241 with :
3342 role-to-assume : arn:aws:iam::052730242331:role/github-actions/explain-ci
3443 aws-region : us-east-1
3544
3645 - name : Login to Amazon ECR
46+ if : github.ref == 'refs/heads/main'
3747 id : login-ecr
3848 uses : aws-actions/amazon-ecr-login@v2
3949
4050 - name : Build docker image
4151 run : docker build -t explain .
42-
4352 - name : Push docker image to Amazon ECR Public
4453 if : github.ref == 'refs/heads/main'
4554 env :
You can’t perform that action at this time.
0 commit comments