-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.84 KB
/
build-ui.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
name: Build UI
on:
push:
paths-ignore:
- "aleph/**"
- "contrib/**"
- "helm/**"
- "mappings/**"
- "site/**"
- "docs/**"
- "requirements.txt"
- "requirements-dev.txt"
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup
run: echo "ALEPH_SECRET=batman\n" >> aleph.env
- name: Build development image
run: |
docker build -t ghcr.io/alephdata/aleph-ui:${GITHUB_SHA} ui
docker tag ghcr.io/alephdata/aleph-ui:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui:latest
- name: Check code formatting
run: make format-check-ui
- name: Run linter
run: make lint-ui
- name: Run tests
run: make test-ui
- name: Build production image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: docker build -t ghcr.io/alephdata/aleph-ui-production:${GITHUB_SHA} -f ui/Dockerfile.production ui
- name: Push docker image (tagged)
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-ui-production:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui-production:${ALEPH_TAG};
docker push ghcr.io/alephdata/aleph-ui-production:${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-ui-production:${GITHUB_SHA} ghcr.io/alephdata/aleph-ui-production:latest;
docker push ghcr.io/alephdata/aleph-ui-production:latest;