-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.23 KB
/
docker.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
name: lambdadockerimage-ecr
on:
pull_request:
jobs:
Docker:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Configure AWS credentials from Test account
uses: aws-actions/configure-aws-credentials@master
with:
role-to-assume: arn:aws:iam::464004139021:role/GithubActionsRole
aws-region: us-east-1
-
name: Create and Display ECR Repo
run: aws ecr create-repository --repository-name xxxxxxxxx || echo "ECR Repo already exists, skipping command."
-
name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: true
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE: xxxxxxxxx
TAG: latest
with:
push: true
context: code/discordlambda
tags: ${{ env.ECR_REGISTRY }}/${{ env.IMAGE }}:${{ env.TAG }}