-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
61 lines (55 loc) · 1.7 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
name: "Build and Publish to Docker"
description: "Pushes built artifacts to Docker"
author: 'soramitsukhmer'
branding:
icon: 'anchor'
color: 'blue'
inputs:
images:
description: 'List of Docker images to use as base name for tags'
required: true
targets:
description: "List of bake targets"
required: false
push:
description: "Push is a shorthand for --set=*.output=type=registry"
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ inputs.images }}
tags: |
type=sha
type=schedule
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Extract GitHub Action metadata for Docker
# https://github.com/dockerbakery/github-metadata-action
- name: Extract GitHub Docker metadata
id: github-meta
uses: dockerbakery/github-metadata-action@v1
# Build and push Docker image with Buildx Bake
# https://github.com/docker/bake-action
- name: Build and push Docker image
if: hashFiles('docker-bake.hcl') != ''
uses: docker/bake-action@v1
with:
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
${{ steps.github-meta.outputs.bake-file }}
targets: ${{ inputs.targets }}
push: ${{ inputs.push }}