File tree 2 files changed +35
-1
lines changed
2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Learn Layer5
2
+
3
+ on :
4
+ push :
5
+ branches : [ master ]
6
+ pull_request :
7
+ branches : [ master ]
8
+
9
+ jobs :
10
+ docker :
11
+ name : Docker build and push
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - name : Check out code
15
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
16
+ uses : actions/checkout@master
17
+ with :
18
+ fetch-depth : 1
19
+ - name : Docker login
20
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
21
+ uses : azure/docker-login@v1
22
+ with :
23
+ username : ${{ secrets.DOCKER_USERNAME }}
24
+ password : ${{ secrets.DOCKER_PASSWORD }}
25
+ - name : Docker build & push
26
+ if : github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master') && success()
27
+ run : |
28
+ make build-img-service
29
+ make image-push
Original file line number Diff line number Diff line change
1
+ VER =$(shell git rev-parse --short HEAD)
2
+
1
3
build-service :
2
4
cd service && go build -a -o ./main .
3
5
@@ -12,4 +14,7 @@ run-service-b:
12
14
./service/main
13
15
14
16
build-img-service :
15
- cd service && docker build -t layer5/sample-app-service:dev .
17
+ cd service && docker build -t layer5/learn-layer5:latest -t layer5/learn-layer5:$(VER ) .
18
+
19
+ image-push :
20
+ docker push layer5/learn-layer5
You can’t perform that action at this time.
0 commit comments