-
Notifications
You must be signed in to change notification settings - Fork 4
46 lines (46 loc) · 1.23 KB
/
docker-build.yml
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
name: Publish Docker image
on:
release:
types: [published]
jobs:
test:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: '1.15'
- name: Checkout
uses: actions/checkout@v2
- name: Restore cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download dependencies
run: go mod download
- name: Run tests
run: make test
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: '1.15'
- name: Check out the repo
uses: actions/checkout@v2
- name: Download dependencies
run: go mod download && go mod vendor
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: tfgco/arkadiko
tag_with_ref: true