-
Notifications
You must be signed in to change notification settings - Fork 1
30 lines (27 loc) · 964 Bytes
/
dockerapi.yml
File metadata and controls
30 lines (27 loc) · 964 Bytes
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
name: APIServer
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Build
run: GOOS=linux GOARCH=amd64 go build -o koala ./pkg/cmd/
- name: Build the Docker image
run: docker build . --file Dockerfile.apiserver --tag chengtian/koala-apiserver:latest
- name: Docker Login
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Push latest image
run: docker push chengtian/koala-apiserver:latest
- name: Push the docker image
run: export v=$(date +%s) && docker tag chengtian/koala-apiserver:latest chengtian/koala-apiserver:alpha-$v && docker push chengtian/koala-apiserver:alpha-$v