-
Notifications
You must be signed in to change notification settings - Fork 4
39 lines (33 loc) · 1.16 KB
/
push-image-to-ecr.yaml
File metadata and controls
39 lines (33 loc) · 1.16 KB
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
name: Push Docker Image to ECR
on:
workflow_dispatch:
push:
branches:
- dev
jobs:
push-to-ecr:
runs-on: ubuntu-latest
env:
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
- name: Build Docker Image
uses: docker/build-push-action@v3
with:
context: .
target: processing
tags: ${{ secrets.ECR_REGISTRY }}:${{ github.sha }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max