File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change
1
+ # docker-build-action
2
+ This GitHub action will log into the specified Docker Registry and build 1 or 2 images based on the given config.
3
+
4
+ ## Config
5
+ ` registry ` : Registry's host
6
+ ` user ` : Registry's user
7
+ ` password ` : Registry user's password or token
8
+ ` image ` : Docker image name without tag
9
+ ` tag ` : Docker image tag
10
+ ` build_dev ` : Creates a -dev image too if set to true
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ inputs:
17
17
tag :
18
18
description : " Docker image tag"
19
19
required : true
20
+ build_dev :
21
+ description : ' Creates a -dev image too if set to true (default: "false")'
22
+ required : true
23
+ default : " false"
20
24
21
25
runs :
22
26
using : " composite"
@@ -38,27 +42,30 @@ runs:
38
42
images : ${{ inputs.image }}
39
43
40
44
- name : Build and push -dev image
45
+ if : ${{ inputs.build_dev }} == "true"
41
46
42
47
with :
43
48
context : ${{ github.workspace }}
44
- cache-from : ${{ inputs.image }}:${{ inputs.tag }}
45
49
platforms : linux/amd64
46
50
push : true
47
51
build-args : |
48
52
DEV=yes
49
53
tags : |
50
54
${{ inputs.image }}:${{ inputs.tag }}-dev
51
55
labels : ${{ steps.meta.outputs.labels }}
56
+ cache-from : type=gha
57
+ cache-to : type=gha,mode=max
52
58
53
59
- name : Build and push prod image
54
60
55
61
with :
56
62
context : ${{ github.workspace }}
57
- cache-from : ${{ inputs.image }}:${{ inputs.tag }}
58
63
platforms : linux/amd64
59
64
push : true
60
65
build-args : |
61
66
DEV=no
62
67
tags : |
63
68
${{ inputs.image }}:${{ inputs.tag }}
64
69
labels : ${{ steps.meta.outputs.labels }}
70
+ cache-from : type=gha
71
+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments