-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.5 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
name: Continuos Integration
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js 12.x
uses: actions/setup-node@master
with:
node-version: 12.x
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Yarn install
run: yarn install
- name: Unit tests
run: yarn run test:unit
- name: Build app
run: yarn run build
- name: Build Docker image
run: docker build . -t eddyanalytics/eddy-ui:latest
- name: Push Docker image
run: |
echo '${{ secrets.CI_REGISTRY_TOKEN }}' | docker login --username eddyanalytics --password-stdin
docker push eddyanalytics/eddy-ui:latest
- name: Check Tag
id: check_tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=match::true
fi
- name: Release Version
if: steps.check_tag.outputs.match == 'true'
run: |
docker tag eddyanalytics/eddy-ui:latest eddyanalytics/eddy-ui:${GITHUB_REF##*/}
docker push eddyanalytics/eddy-ui:${GITHUB_REF##*/}