-
Notifications
You must be signed in to change notification settings - Fork 272
59 lines (46 loc) · 1.69 KB
/
build.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
name: Build
on:
push:
paths-ignore:
- "ui/**"
- "docs/**"
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up
run: |
sudo sysctl -w vm.max_map_count=262144
sudo echo "ALEPH_SECRET=batman\n" >> aleph.env
echo "${GITHUB_REF}"
docker --version
docker-compose --version
- name: Docker pull services
run: |
docker-compose pull --quiet elasticsearch ingest-file
make ALEPH_TAG=${GITHUB_SHA} services
- name: Build docker image
run: docker build -t ghcr.io/alephdata/aleph:${GITHUB_SHA} .
- name: Install development dependencies
run: make dev
- name: Check code formatting
run: make format-check
- name: Run linter
run: make lint
- name: Run aleph tests
run: make ALEPH_TAG=${GITHUB_SHA} test
- name: Push docker images for tags
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
export ALEPH_TAG=${GITHUB_REF/refs\/tags\//}
docker tag ghcr.io/alephdata/aleph:${GITHUB_SHA} ghcr.io/alephdata/aleph:${ALEPH_TAG};
docker push ghcr.io/alephdata/aleph:${ALEPH_TAG};
- name: Tag latest image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/test-')
run: |
docker tag ghcr.io/alephdata/aleph:${GITHUB_SHA} ghcr.io/alephdata/aleph:latest;
docker push ghcr.io/alephdata/aleph:latest;