Skip to content

Commit 4613574

Browse files
author
jasonwalsh
committed
Update CircleCI config to manage GitHub deploys
1 parent 77ee65a commit 4613574

File tree

1 file changed

+35
-2
lines changed

1 file changed

+35
-2
lines changed

.circleci/config.yml

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,45 @@ jobs:
3131
dep ensure
3232
go test -v ./...
3333
working_directory: /go/src/github.com/mongodb/terraform-aws-ecs-task-definition
34+
deploy:
35+
docker:
36+
- image: circleci/golang:1.11-stretch-browsers-legacy
37+
steps:
38+
- checkout
39+
- run:
40+
command: |
41+
go get github.com/tcnksm/ghr
42+
VERSION="$(git tag -l | head -1)"
43+
ghr -t "${GITHUB_TOKEN}" -u "${CIRCLE_PROJECT_USERNAME}" -r "${CIRCLE_PROJECT_REPONAME}" -c "${CIRCLE_SHA1}" -delete "${VERSION}" .
3444
version: 2.1
3545
workflows:
36-
build-test:
46+
build-test-deploy:
3747
jobs:
38-
- build
48+
- build:
49+
filters:
50+
tags:
51+
only: /.*/
3952
- test:
53+
filters:
54+
tags:
55+
only: /.*/
4056
requires:
4157
- build
58+
- pause:
59+
filters:
60+
branches:
61+
ignore: /.*/
62+
tags:
63+
only: /^v.*/
64+
requires:
65+
- test
66+
type: approval
67+
- deploy:
68+
filters:
69+
branches:
70+
ignore: /.*/
71+
tags:
72+
only: /^v.*/
73+
requires:
74+
- pause
4275
version: 2

0 commit comments

Comments
 (0)