This repository has been archived by the owner on Apr 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (80 loc) · 2.51 KB
/
ci.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
77
78
79
80
81
82
83
name: CI
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master
env:
IMAGE_TAG: ${{ github.sha }}
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-node@v1
with:
node-version: '12.15'
- uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-yarn-client-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-client-
- name: Lint
run: make lint
- name: Unit Test
run: make test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: whoan/docker-build-with-cache-action@v5
with:
username: libero
password: "${{ secrets.GITHUB_TOKEN }}"
image_name: libero/reviewer-client/reviewer-client
image_tag: ${{ github.sha }}
registry: docker.pkg.github.com
build_extra_args: "--build-arg=image_tag=${IMAGE_TAG}"
browsertest-and-push-images:
needs: [test, build ]
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup client with mocks
run: |
echo $GITHUB_TOKEN | docker login docker.pkg.github.com -u $GITHUB_ACTOR --password-stdin
docker pull docker.pkg.github.com/libero/reviewer-client/reviewer-client:${IMAGE_TAG}
docker tag docker.pkg.github.com/libero/reviewer-client/reviewer-client:${IMAGE_TAG} libero/reviewer-client:${IMAGE_TAG}
make setup
make start_ci
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- run: make build_browsertest
- name: Push images to docker hub
run: |
.scripts/github/retag-and-push.sh reviewer-client $IMAGE_TAG
.scripts/github/retag-and-push.sh reviewer-browsertests $IMAGE_TAG
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Notify slack on failure
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
uses: voxmedia/github-action-slack-notify-build@v1
with:
channel: libero-reviewer-tech
status: FAILED
color: danger