-
Notifications
You must be signed in to change notification settings - Fork 584
56 lines (46 loc) · 1.15 KB
/
build-images.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
49
50
51
52
53
54
55
56
name: Build & Publish images
on:
workflow_dispatch:
inputs:
tag:
description: "Image Tag"
required: false
type: string
pull_request:
branches:
- v2
- main
env:
DF_IMG_TAG: ${{ inputs.tag || github.sha }}
jobs:
docker:
runs-on: ['self-hosted']
steps:
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Cache golang modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout repo
uses: actions/checkout@v2
- name: Build images
run: |
make
- name: Push images
run: |
make publish
- name: Output image tag
run: echo "New image tag ${DF_IMG_TAG}" >> $GITHUB_STEP_SUMMARY