4
4
push :
5
5
tags :
6
6
- ' v*.*.*'
7
+
7
8
env :
8
9
AWS_REGION : us-west-2
9
10
19
20
- name : Set up QEMU
20
21
uses : docker/setup-qemu-action@v2
21
22
22
- - name : Docker meta
23
- id : meta
24
- uses : docker/metadata-action@v3
25
- with :
26
- images : |
27
- scrolltech/rollup-explorer-backend
28
- tags : |
29
- type=semver,pattern={{version}}
30
-
31
23
- name : Set up Docker Buildx
32
24
uses : docker/setup-buildx-action@v2
33
25
37
29
username : ${{ secrets.DOCKERHUB_USERNAME }}
38
30
password : ${{ secrets.DOCKERHUB_TOKEN }}
39
31
40
- - name : Login to Github
41
- uses : docker/login-action@v2
42
- with :
43
- registry : ghcr.io
44
- username : ${{ secrets.PAT_OWNER }}
45
- password : ${{ secrets.PAT_TOKEN }}
46
-
47
- - name : Build image
48
- id : build
49
- uses : docker/build-push-action@v3
50
- with :
51
- push : true
52
- tags : ${{ steps.meta.outputs.tags }}
53
-
54
32
# build and push to aws ecr
55
33
- name : Configure AWS credentials
56
34
uses : aws-actions/configure-aws-credentials@v4
@@ -63,14 +41,17 @@ jobs:
63
41
id : login-ecr
64
42
uses : aws-actions/amazon-ecr-login@v2
65
43
66
- - name : Build, tag, and push image to Amazon ECR
67
- id : build-image
44
+ - name : Build image
45
+ id : build
68
46
env :
69
47
ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
70
48
ECR_REPOSITORY : rollup-explorer-backend
71
- IMAGE_TAG : ${{github.ref_name}}
72
- run : |
73
- # Build a docker container and push it to ECR
74
- # docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
75
- docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
76
- docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
49
+ IMAGE_TAG : ${{ github.ref_name }}
50
+ uses : docker/build-push-action@v3
51
+ with :
52
+ push : true
53
+ tags : |
54
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
55
+ ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.ECR_REPOSITORY }}:latest
56
+ ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
57
+ ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
0 commit comments