-
-
Notifications
You must be signed in to change notification settings - Fork 68
71 lines (69 loc) · 1.95 KB
/
sub_build.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: (level 2 sub) Build
on:
workflow_call:
inputs:
BASE_IMAGE_REGISTRY:
required: false
type: string
BASE_IMAGE_NAME:
required: false
type: string
IMAGE_REGISTRY:
required: true
type: string
IMAGE_NAME:
required: true
type: string
IMAGE_TAG:
required: true
type: string
IMAGE_VERSION:
required: false
type: string
DOCKERFILE:
required: true
type: string
ARCH:
required: true
type: string
jobs:
build:
name: Build or pull image (${{ inputs.ARCH }})
timeout-minutes: 360
runs-on:
- self-hosted
- builder
- ${{ inputs.ARCH }}
steps:
- name: (dbg) pre-build docker info
run: |
docker image ls -a
docker ps
- name: Checkout
uses: actions/checkout@main
- name: Prepare build
# Preparing variables used for tagging the image to build
id: prepare
run: echo "BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
- name: Build the image
if: success()
uses: docker/build-push-action@master
with:
load: true
no-cache: true
build-args: |
BASE_IMAGE_REGISTRY=${{ inputs.BASE_IMAGE_REGISTRY }}
BASE_IMAGE_NAME=${{ inputs.BASE_IMAGE_NAME }}
TAG=${{ inputs.IMAGE_TAG }}
VERSION=${{ inputs.IMAGE_VERSION }}
BUILD_DATE=${{ steps.prepare.outputs.BUILD_DATE }}
tags: "${{ inputs.IMAGE_REGISTRY }}:${{ inputs.IMAGE_NAME }}"
platforms: linux/${{ inputs.ARCH }}
file: ${{ inputs.DOCKERFILE }}
context: .
- name: (dbg) post-build inspect image
if: success()
run: docker inspect ${{ inputs.IMAGE_REGISTRY }}:${{ inputs.IMAGE_NAME }}
- name: (dbg) post-build docker info
if: always()
run: docker image ls -a