File tree Expand file tree Collapse file tree 2 files changed +61
-4
lines changed Expand file tree Collapse file tree 2 files changed +61
-4
lines changed Original file line number Diff line number Diff line change
1
+ name : deploy to development
2
+ permissions :
3
+ id-token : write
4
+ contents : read
5
+ on :
6
+ push :
7
+ branches : [develop]
8
+ jobs :
9
+ deploy :
10
+ environment :
11
+ name : development
12
+ url : https://string-api.dev.string-api.xyz
13
+
14
+ name : build push and deploy
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v3
19
+
20
+ - name : setup go
21
+ uses : actions/setup-go@v3
22
+ with :
23
+ go-version-file : go.mod
24
+ cache : true
25
+ cache-dependency-path : go.sum
26
+ - name : install deps and build
27
+ # # TODO: Move all building into the docker container
28
+ run : |
29
+ go mod download
30
+ GOOS=linux GOARCH=amd64 go build -o ./cmd/app/main ./cmd/app/main.go
31
+
32
+ - name : configure aws credentials
33
+ uses :
aws-actions/[email protected]
34
+ with :
35
+ aws-region : us-west-2
36
+ role-to-assume : ${{ secrets.ASSUME_ROLE }}
37
+
38
+ - name : login to Amazon ECR
39
+ id : login-ecr
40
+ uses : aws-actions/amazon-ecr-login@v1
41
+
42
+ - name : tag and push to Amazon ECR
43
+ env :
44
+ ECR_REPO : ${{ secrets.AWS_ACCT }}.dkr.ecr.us-west-2.amazonaws.com
45
+ SERVICE : string-api
46
+ IMAGE_TAG : latest
47
+ run : |
48
+ docker build -t $ECR_REPO/$SERVICE:$IMAGE_TAG ./cmd/app/
49
+ docker push $ECR_REPO/$SERVICE:$IMAGE_TAG
50
+
51
+ - name : deploy
52
+ env :
53
+ CLUSTER : string-core
54
+ SERVICE : string-api
55
+ AWS_REGION : us-west-2
56
+ run : |
57
+ aws ecs --region $AWS_REGION update-service --cluster $CLUSTER --service $SERVICE --force-new-deployment
58
+
Original file line number Diff line number Diff line change 2
2
pull_request :
3
3
branches :
4
4
- develop
5
-
6
5
name : run tests
7
6
jobs :
8
7
lint :
17
16
cache : true
18
17
cache-dependency-path : go.sum
19
18
- name : Install golangci-lint
20
- run : go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.3
19
+ run : go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
21
20
- name : Run golangci-lint
22
21
run : golangci-lint run --version --verbose --out-format=github-actions
23
22
56
55
- name : Coveralls
57
56
uses :
coverallsapp/[email protected]
58
57
with :
59
- github-token : ${{ secrets.github_token }}
60
- path-to-lcov : coverage.lcov
58
+ github-token : ${{ secrets.GITHUB_TOKEN }}
59
+ path-to-lcov : coverage.lcov
You can’t perform that action at this time.
0 commit comments