-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (47 loc) · 1.43 KB
/
aws-ecr-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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: CD/ECR
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: ECR
runs-on: buildjet-4vcpu-ubuntu-2204-arm
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Submodules
run: git submodule init && git submodule update --remote
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Get ECR Registry
id: ecr-login
uses: aws-actions/amazon-ecr-login@v1
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: ${{ steps.ecr-login.outputs.registry }}
- name: Set up Docker Buildkit
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
- name: Get Tags for Image
id: metadata
uses: docker/metadata-action@v3
with:
images: ${{ steps.ecr-login.outputs.registry }}/escape-bot
tags: |
type=raw,value=latest
- name: Docker Build, Tag and Push to ECR
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/arm64
push: true
tags: ${{ steps.metadata.outputs.tags }}
build-args: GIT_SHA=${{ github.sha }}