-
Notifications
You must be signed in to change notification settings - Fork 27
54 lines (48 loc) · 1.77 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
name: package
on:
push:
merge_group:
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up
run: |
docker --version
docker-compose --version
echo "${GITHUB_REF}"
- name: Start services
run: |
make services
- name: Build docker images
run: |
make cached-build
- name: Install development dependencies
run: make dev
- name: Check formatting
run: make format-check
- name: Run linter (ruff)
run: make lint
- name: Run tests
run: make test
- name: Push docker images (hash)
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')) && github.actor != 'dependabot[bot]'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker tag ghcr.io/alephdata/ingest-file ghcr.io/alephdata/ingest-file:${GITHUB_SHA}
docker push ghcr.io/alephdata/ingest-file:${GITHUB_SHA}
docker tag ghcr.io/alephdata/ingest-file ghcr.io/alephdata/ingest-file:cache
docker push ghcr.io/alephdata/ingest-file:cache
- name: Push docker images for tags
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: |
export TAG=${GITHUB_REF/refs\/tags\//}
docker tag ghcr.io/alephdata/ingest-file ghcr.io/alephdata/ingest-file:${TAG};
docker push ghcr.io/alephdata/ingest-file:${TAG};
- name: Tag latest image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/test-')
run: |
docker push ghcr.io/alephdata/ingest-file;