-
Notifications
You must be signed in to change notification settings - Fork 4
41 lines (40 loc) · 1.08 KB
/
build.yml
File metadata and controls
41 lines (40 loc) · 1.08 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
name: Build (Generic)
on:
workflow_call:
inputs:
build_target:
description: 'Build target for buildx bake'
required: true
type: string
base_image_name:
default: 'kcollins/mssql'
required: false
type: string
secrets:
dockerhub_username:
required: true
dockerhub_token:
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Buildx Setup
id: buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_token }}
- name: Build
uses: docker/bake-action@v4.1.0
env:
BASE_IMAGE_NAME: ${{ inputs.base_image_name }}
with:
files: ./docker-bake.hcl
targets: ${{ inputs.build_target }}
push: ${{ github.event_name != 'pull_request' }}