-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yaml
More file actions
64 lines (57 loc) · 1.94 KB
/
action.yaml
File metadata and controls
64 lines (57 loc) · 1.94 KB
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
name: docker-deploy-image
inputs:
registry:
description: 'The registry to push the image to'
required: false
default: ''
registry_username:
description: 'The username to use to push the image'
required: false
default: ''
registry_password:
description: 'The password to use to push the image'
required: false
default: ''
image_name:
description: 'The name of the image to push'
required: false
default: ''
platforms:
description: 'The platforms to build the image for'
required: false
default: 'linux/amd64,linux/arm64'
push:
description: 'Whether to push the image'
required: false
default: false
runs:
using: composite
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
- name: Log in to the Container registry
if: ${{ inputs.push == true || inputs.push == 'true' }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.registry_username }}
password: ${{ inputs.registry_password }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
with:
images: ${{ inputs.registry }}/${{ inputs.image_name }}
tags: |
type=semver,pattern={{version}}
type=pep440,pattern={{version}}
type=ref,event=branch
- name: Build and push Docker image
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
context: .
push: ${{ inputs.push }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ inputs.platforms }}