forked from neorusa/profanity-filter
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (45 loc) · 1.51 KB
/
build-image.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
name: Build and push images
on:
workflow_dispatch:
push:
branches:
- master
env:
PYTHON_VERSION: 3.9
NODE_VERSION: 16
REPOSITORY: emma/profanity-filter
jobs:
build_image:
name: Build and push image to ECR
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Get latest release tag
id: release-tag
uses: rez0n/actions-github-release@main
env:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
type: "stable"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- 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: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Build, tag, and push the docker image
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
BASE_IMAGE_NAME: ${{ steps.login-ecr.outputs.registry }}/emma/base
BUILDER_IMAGE_NAME: ${{ steps.login-ecr.outputs.registry }}/emma/builder
run: |
docker build --build-arg BUILDER_IMAGE_NAME --build-arg BASE_IMAGE_NAME --load -t $REGISTRY/$REPOSITORY:latest .
docker push -a $REGISTRY/$REPOSITORY