-
Notifications
You must be signed in to change notification settings - Fork 36
48 lines (41 loc) · 1.08 KB
/
.reusable-build.yaml
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
name: _build
on:
workflow_call:
inputs:
component-name:
required: true
type: string
registry:
required: false
type: string
default: ghcr.io
registry-user:
required: true
type: string
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
cache: true
- name: Login to GitHub container registry
uses: docker/login-action@v2
with:
registry: ${{ inputs.registry }}
username: ${{ inputs.registry-user }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check Version
id: version
run: head -2 Makefile | cut -d "=" -s -f 2 | xargs
- name: Build Docker image
run: make docker-build-${{ inputs.component-name }}
- name: Push Docker image
run: make docker-push-${{ inputs.component-name }}