forked from serversideup/github-action-docker-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
97 lines (91 loc) · 3.48 KB
/
Copy pathaction.yml
File metadata and controls
97 lines (91 loc) · 3.48 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: 'docker-build-action'
description: 'Simplified Docker image builds with Github Actions.'
inputs:
tags:
description: 'Enter the tag you would like to name your image with. (example: myorg/myapp:production)'
required: true
registry-username:
description: 'Enter the username to authenticate with your registry.'
default: ''
registry-password:
description: 'Enter the password or token to authenticate with your registry. (an access token is highly recommended)'
default: ''
registry-token:
description: '[DEPRECATED - Use registry-password instead] Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
default: ''
registry:
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
default: 'docker.io' # Default to Docker Hub if not specified
required: false
registry-2:
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
registry-2-username:
description: 'Enter the username to authenticate with your registry.'
default: ''
registry-2-password:
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
default: ''
registry-3:
description: 'Registry to authenticate with (e.g., "docker.io" or "ghcr.io").'
registry-3-username:
description: 'Enter the username to authenticate with your registry.'
default: ''
registry-3-password:
description: 'Enter the token or password to authenticate with your registry. (an access token is highly recommended)'
default: ''
context:
description: 'The build context directory (the directory containing your Dockerfile and build files).'
default: '.'
required: false
dockerfile:
description: 'Filename of the Dockerfile within the context that you set.'
default: './Dockerfile'
required: false
target:
description: 'Set the target build stage to build.'
default: ''
required: false
platforms:
description: 'Comma separated list of platforms.'
default: 'linux/amd64'
required: false
runs:
using: 'composite'
steps:
- name: Login to Container Registry
uses: docker/login-action@v3
with:
username: ${{ inputs.registry-username }}
password: ${{ inputs.registry-password || inputs.registry-token }}
registry: ${{ inputs.registry }}
- name: "Login to Container Registry #2"
if: inputs.registry-2-username != ''
uses: docker/login-action@v3
with:
username: ${{ inputs.registry-2-username }}
password: ${{ inputs.registry-2-password }}
registry: ${{ inputs.registry-2 }}
- name: "Login to Container Registry #3"
if: inputs.registry-3-username != ''
uses: docker/login-action@v3
with:
username: ${{ inputs.registry-3-username }}
password: ${{ inputs.registry-3-password }}
registry: ${{ inputs.registry-3 }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ${{ inputs.context }}
platforms: ${{ inputs.platforms }}
file: ${{ inputs.dockerfile }}
pull: true
push: true
tags: ${{ inputs.tags }}
target: ${{ inputs.target }}
branding:
icon: 'server'
color: 'blue'