forked from lorserker/ben
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.43 KB
/
build.workflow.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: Upgrade Ben API image
on:
push:
tags:
- '*'
env:
AWS_ACCOUNT_ID: "004345335763"
AWS_REGION: "eu-central-1"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-push-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow --tags
continue-on-error: true
- name: Update the submodule
run: git submodule update --remote --init --recursive
- name: Install Build Essential
run: sudo apt-get install build-essential
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to ECR
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ env.AWS_ACCESS_KEY_ID }}
password: ${{ env.AWS_SECRET_ACCESS_KEY }}
env:
AWS_REGION: ""
- name: Build and push the image
env:
VERSION: ${{ github.ref_name }}
DOCKER_REPO: public.ecr.aws/i8e5j7a1/robot-api
DOCKER_TAG: public.ecr.aws/i8e5j7a1/robot-api:${{ github.ref_name }}
shell: bash
run: make buildx_push