-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (38 loc) · 1.23 KB
/
build.yaml
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
---
name: Build and push image
on:
push:
branches: ['main']
permissions:
id-token: write
contents: read
jobs:
build:
name: Build and push
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Setup Poetry
uses: snok/install-poetry@v1
- name: Generate requirements.txt
run: poetry export -f requirements.txt -o requirements.txt
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: eu-west-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build and push Docker image
uses: docker/[email protected]
with:
push: true
tags: ${{ steps.login-ecr.outputs.registry }}/concrexit/facedetection-lambda:latest
platforms: linux/amd64 # Lambda requires single-platform images,
provenance: false # see https://stackoverflow.com/q/65608802.
cache-from: type=gha
cache-to: type=gha,mode=max