File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker build images
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+
9+ env :
10+ AWS_REGION : eu-central-1
11+
12+ permissions :
13+ id-token : write
14+ contents : read
15+
16+ jobs :
17+ build :
18+ runs-on : ubuntu-latest
19+ strategy :
20+ matrix :
21+ image : [ 'grafana', 'postgres' ]
22+ steps :
23+ - uses : actions/checkout@v4
24+
25+ - name : Set AWS credentials
26+ uses : aws-actions/configure-aws-credentials@v4
27+ with :
28+ role-to-assume : arn:aws:iam::615677714887:role/postgres-grafana-on-ecs-role
29+ aws-region : ${{ env.AWS_REGION }}
30+
31+ - name : Set up Docker Buildx
32+ uses : docker/setup-buildx-action@v1
33+
34+ - name : Login to Amazon ECR
35+ id : login-ecr
36+ uses : aws-actions/amazon-ecr-login@v2
37+
38+ - name : Build, tag, and push docker image to Amazon ECR
39+ uses : docker/build-push-action@v5
40+ with :
41+ context : ./src/grafana
42+ push : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
43+ tags : 615677714887.dkr.ecr.eu-central-1.amazonaws.com/postgres-grafana-on-ecs-${{ matrix.image }}-repo
44+ cache-from : type=gha
45+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments