-
Notifications
You must be signed in to change notification settings - Fork 39
51 lines (48 loc) · 1.63 KB
/
tests-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
on:
workflow_call:
inputs:
name:
type: string
description: Name
required: true
image_name:
type: string
description: Image name
required: true
target:
type: string
description: Image target
required: true
jobs:
build-image:
name: Build ${{ inputs.name }} image
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to ECR
uses: ./.github/actions/aws_ecr_login
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ vars.AWS_REGION }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}
- name: Build and push by SHA
uses: ./.github/actions/docker
with:
image_name: ${{ inputs.image_name }}
image_org: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ vars.AWS_REGION }}.amazonaws.com
target: ${{ inputs.target }}
platform: linux/amd64
push_tags: true
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
cache_region: ${{ vars.CACHE_REGION }}
cache_bucket: ${{ vars.CACHE_S3_BUCKET }}
cache_endpoint: ${{ vars.CACHE_S3_ENDPOINT }}
cache_access_key_id: ${{ secrets.CACHE_KEY_ID }}
cache_secret_access_key: ${{ secrets.CACHE_SECRET_KEY }}
cache_to_name: ${{ github.event_name == 'push' && 'true' || 'false' }}