This repository was archived by the owner on Dec 5, 2023. It is now read-only.
File tree 3 files changed +76
-1
lines changed
3 files changed +76
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : ci
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - " *" # run for branches
7
+ tags :
8
+ - " *" # run for tags
9
+
10
+ jobs :
11
+ test :
12
+ runs-on : ubuntu-latest
13
+ env :
14
+ GROUP : weaveworksdemos
15
+ COMMIT : ${{ github.sha }}
16
+ REPO : front-end
17
+ steps :
18
+ - uses : actions/checkout@v2
19
+
20
+ #
21
+ #
22
+ # Set up node
23
+ - uses : actions/setup-node@v1
24
+ with :
25
+ node-version : ' 4.x'
26
+
27
+ #
28
+ #
29
+ # Install dependencies
30
+ - run : npm install
31
+
32
+ #
33
+ #
34
+ # Run node tests in docker image
35
+ - name : Test image
36
+ env :
37
+ DOCKER_BUILDKIT : 1
38
+ run : make test
39
+
40
+ #
41
+ #
42
+ # Build docker image for service
43
+ - name : Build docker image
44
+ uses : docker/build-push-action@v1
45
+ if : startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
46
+ with :
47
+ push : false
48
+ repository : ${{ env.GROUP }}/${{ env.REPO }}
49
+ tag_with_ref : true
50
+ tag_with_sha : true
51
+ tags : ${{ github.sha }}
52
+
53
+ #
54
+ #
55
+ # Run simple test against built container
56
+ - name : Test docker image
57
+ if : startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
58
+ env :
59
+ DOCKER_BUILDKIT : 1
60
+ run : ./test/container.sh
61
+
62
+ #
63
+ #
64
+ # Push to dockerhub
65
+ - name : Push to Docker Hub
66
+ uses : docker/build-push-action@v1
67
+ if : startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
68
+ with :
69
+ username : ${{ secrets.DOCKER_USERNAME }}
70
+ password : ${{ secrets.DOCKER_PASSWORD }}
71
+ repository : ${{ env.GROUP }}/${{ env.REPO }}
72
+ tag_with_ref : true
73
+ tag_with_sha : true
Original file line number Diff line number Diff line change 1
1
IMAGE =front-end
2
+ DOCKER_IFLAG := $(if $(GITHUB_ACTIONS ) ,"-i","-it")
2
3
3
4
.PHONY : test coverage
4
5
@@ -46,7 +47,7 @@ test-image:
46
47
test : test-image
47
48
@docker run \
48
49
--rm \
49
- -it \
50
+ $( DOCKER_IFLAG ) \
50
51
-v $$ PWD:/usr/src/app \
51
52
$(IMAGE ) /usr/local/bin/npm test
52
53
Original file line number Diff line number Diff line change 1
1
[ ![ Build Status] ( https://travis-ci.org/microservices-demo/front-end.svg?branch=master )] ( https://travis-ci.org/microservices-demo/front-end )
2
2
[ ![ ] ( https://images.microbadger.com/badges/image/weaveworksdemos/front-end.svg )] ( http://microbadger.com/images/weaveworksdemos/front-end " Get your own image badge on microbadger.com ")
3
+ [ ![ Actions Status] ( https://github.com/microservices-demo/front-end/workflows/ci/badge.svg )] ( https://github.com/microservices-demo/front-end/workflows/ci/badge.svg )
3
4
4
5
5
6
Front-end app
You can’t perform that action at this time.
0 commit comments