CircleCi project setup (#32)

Add .circleci/config.yml
This commit is contained in:
Philipp Böhm 2021-02-20 16:42:04 +01:00 committed by GitHub
parent 016eea259c
commit bc8c5e2810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 56 additions and 0 deletions

56
.circleci/config.yml Normal file
View File

@ -0,0 +1,56 @@
version: 2.1
orbs:
docker: circleci/docker@1.5.0
jobs:
test:
docker:
- image: circleci/golang:1.16
working_directory: /go/src/github.com/pboehm/ddns
steps:
- checkout
- run: go get -v -t -d ./...
- run: go test -v ./...
docker-build:
executor: docker/docker
steps:
- setup_remote_docker
- checkout
- docker/build:
image: pboehm/ddns
dockerfile: docker/ddns/Dockerfile
docker-build-and-push:
executor: docker/docker
steps:
- setup_remote_docker
- checkout
- docker/check
- docker/build:
image: pboehm/ddns
dockerfile: docker/ddns/Dockerfile
- docker/push:
image: pboehm/ddns
tag: $CIRCLE_SHA1,latest
workflows:
commit:
jobs:
- test:
filters: # required since `docker-XXXX` have tag filters AND require `test`
tags:
only: /.*/
- docker-build:
requires:
- test
filters:
branches:
ignore: master
- docker-build-and-push:
requires:
- test
filters:
branches:
only: master