-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
81 lines (77 loc) · 2.54 KB
/
action.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
72
73
74
75
76
77
78
79
80
81
name: 'Build Container Image'
description: 'Create a docker container image'
inputs:
tags:
description: "List of image tags (newline separated) for the resulting container image"
required: true
type: string
push:
description: "If true, the image will be pushed to the registry"
required: false
default: false
type: boolean
platforms:
description: "Comma separated list of platforms to build the image for, i.e. 'linux/amd64,linux/arm64'"
required: false
default: "linux/amd64"
type: string
context:
description: "Context directory for the container image build"
required: false
default: "."
type: string
build-args:
description: "List of build arguments (newline separated) to be inserted in the container image build"
required: false
default: ""
type: string
file:
description: "Name of the dockerfile to build"
required: false
default: "Dockerfile"
type: string
no-cache:
description: "Set to false to enable caching of docker layers"
required: false
default: true
type: boolean
pull:
description: "Pull base images from the registry when not available locally"
required: false
default: true
type: boolean
token:
description: "GitHub token for logging into the ghcr container registry"
required: false
type: string
default: ${{ github.token }}
load:
description: "Make the built image available to the current job. Load is a shorthand for `--output=type=docker`"
required: false
type: boolean
default: false
runs:
using: composite
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
- name: Login to GitHub Container Registry
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.token }}
- name: Build${{ inputs.push && ' and push' || ''}}
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0
with:
context: "${{ inputs.context }}"
file: "${{ inputs.file }}"
platforms: "${{ inputs.platforms }}"
no-cache: ${{ inputs.no-cache }}
pull: ${{ inputs.pull }}
build-args: "${{ inputs.build-args }}"
push: ${{ inputs.push }}
tags: "${{ inputs.tags }}"
load: "${{ inputs.load }}"