-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 924 Bytes
/
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
name: CI
on:
pull_request:
push:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
env:
NODE_ENV: test
steps:
- name: Check out code
uses: actions/checkout@v2
- id: cache-docker
uses: actions/cache@v2
with:
path: /tmp/docker-save
key: docker-save-${{ hashFiles('Dockerfile', 'package-lock.json') }}
- if: steps.cache-docker.outputs.cache-hit == 'true'
name: Load cached Docker image
run: docker load -i /tmp/docker-save/snapshot.tar || true
- name: Build
run: script/ci/cibuild
- name: Test
run: script/ci/test
- if: always() && steps.cache-docker.outputs.cache-hit != 'true'
name: Prepare Docker cache
run: mkdir -p /tmp/docker-save && docker save app_test:latest -o
/tmp/docker-save/snapshot.tar && ls -lh /tmp/docker-save