-
Notifications
You must be signed in to change notification settings - Fork 11
49 lines (45 loc) · 1.33 KB
/
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
49
name: build
on:
push:
branches:
- '**'
tags:
- v[0-9]+.[0-9]+.[0-9]+
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v3
with:
skip-pkg-cache: true
skip-build-cache: true
- name: Build
run: |
make vet check controller
- name: Resolve image properties
uses: actions/github-script@v7
id: imageprops
with:
script: |
core.setOutput('push', '${{ github.ref_type }}' == 'tag' || '${{ github.ref_name }}' == 'main')
core.setOutput('tag', '${{ github.ref_type }}' == 'tag' ? '${{ github.ref_name }}' : 'latest')
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
if: steps.imageprops.outputs.push == 'true'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build container image
uses: docker/build-push-action@v5
with:
context: .
push: ${{ steps.imageprops.outputs.push == 'true' }}
tags: zlabjp/nghttpx-ingress-controller:${{ steps.imageprops.outputs.tag }}
provenance: false