forked from saulmaldonado/agones-minecraft
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (48 loc) · 1.26 KB
/
CD.yml
File metadata and controls
58 lines (48 loc) · 1.26 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CD
on:
push:
branches:
- main
paths:
- 'controller/**'
tags:
- v*.*.*
jobs:
test-build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.3
- name: Set up testing env.
run: |
os=$(go env GOOS)
arch=$(go env GOARCH)
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
- name: Test
working-directory: ./controller
run: go test -v ./...
- name: Docker meta
id: meta
uses: crazy-max/ghaction-docker-meta@v2
with:
images: saulmaldonado/agones-mc-dns-controller
flavor: |
latest=true
tags: |
type=semver,pattern={{version}}
type=sha,prefix=
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: ./controller
push: true
tags: ${{ steps.meta.outputs.tags }}