forked from kubermatic/machine-controller
-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (41 loc) · 986 Bytes
/
cicd.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
name: Publish docker image
on:
push:
pull_request:
jobs:
test:
name: run unit tests
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod
cache: true
-
name: Run the tests
run: make test-unit
publish:
runs-on: ubuntu-latest
needs: test
if: startsWith(github.ref, 'refs/tags/v')
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: run make
env:
REGISTRY_NAMESPACE: syseleven
run: make IMAGE_TAG=$(basename $GITHUB_REF) docker-image-publish
shell: bash