diff --git a/.circleci/config.yml b/.circleci/config.yml index 5ef473a..60acf02 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,14 +3,34 @@ # Check https://circleci.com/docs/2.0/language-go/ for more details version: 2 jobs: + build: docker: - image: circleci/golang:1.9 - working_directory: /go/src/github.com/hipages/php-fpm_exporter steps: - checkout - - run: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep - run: dep ensure -vendor-only - - run: go test -v ./... \ No newline at end of file + - run: go test -v ./... + + deploy: + docker: + - image: circleci/golang:1.9 + working_directory: /go/src/github.com/hipages/php-fpm_exporter + steps: + - run: curl -L -s https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -o /go/bin/dep && chmod +x /go/bin/dep + - run: dep ensure -vendor-only + - run: curl -sL https://git.io/goreleaser | bash + +workflows: + version: 2 + build-n-deploy: + jobs: + - build + - deploy: + requires: + - build + filters: + tags: + only: /v[0-9]+(\.[0-9]+)*(-.*)*/ \ No newline at end of file