-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.11 KB
/
build.yaml
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
name: Build
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build-env:
name: Build CI environment
runs-on: ubuntu-20.04
outputs:
image: ${{ steps.buildkit.outputs.image }}:${{ steps.buildkit.outputs.tag }}
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: chmod +r ~/.docker/config.json
- name: Build and push shell Docker image
id: buildkit
uses: shopstic/buildkit-action@1.0.12
with:
context: ${{ github.workspace }}/shell
image: shopstic/chopsticks-ci
tag: ${{ hashFiles('shell/*') }}
skipIfExists: true
build-apps:
name: Build libraries
needs: build-env
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Cache coursier
uses: actions/cache@v2
with:
path: |
~/.cache
~/.sbt
key: coursier-${{ hashFiles('build.sbt') }}
restore-keys: |
coursier-
- name: Cache sbt targets
uses: actions/cache@v2
with:
path: |
./target
./**/target
key: target-1.5.1-${{ github.sha }}
restore-keys: |
target-1.5.1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: chmod +r ~/.docker/config.json
- name: Build
env:
SHELL_IMAGE: ${{ needs.build-env.outputs.image }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
echo "Restored cache stats ---------------------------------------------"
du -sh ~/.cache || true
find . -type d -name target | xargs -I{} du -sh {}
echo "------------------------------------------------------------------"
mkdir -p ~/.sbt ~/.cache
./cli.sh ci_run_in_shell