This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
57 lines (55 loc) · 1.66 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
name: Node.js CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
strategy:
matrix:
node-version: [14.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ matrix.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-yarn-
- run: yarn --frozen-lockfile
- run: yarn build
- run: yarn lint
- run: yarn coverage
- run: yarn test:ignored-in-coverage
- name: Coveralls
uses: coverallsapp/github-action@master
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-deploy:
runs-on: ubuntu-latest
needs: test
env:
DOCKERHUB_PROJECT: gp-v2-contracts
DOCKER_NAME: ${{ secrets.DOCKER_NAME }}
steps:
- uses: actions/checkout@v2
- name: Dockerhub login
uses: docker/login-action@v1
if: ${{ env.DOCKER_NAME != '' }}
with:
username: ${{ secrets.DOCKER_NAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Deploy Main
if: ${{ env.DOCKER_NAME != '' && github.ref == 'refs/heads/main' }}
run: bash src/docker/deploy.sh staging
- name: Deploy Tag
if: ${{ env.DOCKER_NAME != '' && startsWith(github.ref, 'refs/tags/') }}
run: bash src/docker/deploy.sh ${GITHUB_REF##*/}