forked from try-panwiac/front-end
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (68 loc) · 1.49 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: ci
on:
push:
branches:
- "*" # run for branches
tags:
- "*" # run for tags
pull_request:
branches:
- "*" # run for branches
tags:
- "*" # run for tags
jobs:
test:
runs-on: ubuntu-latest
env:
GROUP: weaveworksdemos
COMMIT: ${{ github.sha }}
REPO: front-end
steps:
- uses: actions/checkout@v2
#
#
# Set up node
- uses: actions/setup-node@v1
with:
node-version: '4.x'
#
#
# Install dependencies
- run: npm install
#
#
# Run node tests in docker image
- name: Test image
env:
DOCKER_BUILDKIT: 1
run: make test
#
#
# Build docker image for service
- name: Build docker image
uses: docker/build-push-action@v1
with:
push: false
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true
tags: ${{ github.sha }}
#
#
# Run simple test against built container
- name: Test docker image
env:
DOCKER_BUILDKIT: 1
run: ./test/container.sh
#
#
# Push to dockerhub
- name: Push to Docker Hub
uses: docker/build-push-action@v1
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: ${{ env.GROUP }}/${{ env.REPO }}
tag_with_ref: true
tag_with_sha: true