-
-
Notifications
You must be signed in to change notification settings - Fork 16
77 lines (68 loc) · 2.29 KB
/
pull_request.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
name: Pull Request
on:
pull_request:
jobs:
build_and_test_frontend:
uses: ./.github/workflows/frontend.yaml
secrets: inherit
build_and_test_backend:
uses: ./.github/workflows/backend.yaml
secrets: inherit
get-distros:
name: "Calculate list of debian distros and docker image tags"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- id: set-distros
run: |
# if we're running from a tag, get the full list of distros; otherwise just use debian:sid
dists='["debian:bookworm"]'
tags="latest $GITHUB_SHA"
if [[ $GITHUB_REF == refs/tags/* ]]; then
dists=$(tools/build_debian_packages.py --show-dists-json)
tags="latest $GITHUB_SHA latest-release $GITHUB_REF_NAME"
fi
echo "::set-output name=distros::$dists"
echo "::set-output name=tags::$tags"
# map the step outputs to job outputs
outputs:
distros: ${{ steps.set-distros.outputs.distros }}
tags: ${{ steps.set-distros.outputs.tags }}
test-build-docker:
name: Build and publish ready made docker containers
runs-on: ubuntu-latest
needs:
- get-distros
steps:
- uses: actions/checkout@v4
- name: Set up Nodejs
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: frontend
- name: Build API Image
id: build-api-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.DOCKER_IMAGE_NAME_API }}
tags: ${{ needs.get-distros.outputs.tags }}
platforms: linux/arm/v7, linux/arm64/v8, linux/amd64, linux/arm64
containerfiles: |
./docker/Dockerfile-api
- name: Build Frontend
working-directory: frontend
run: npx nx build web
- name: Build Frontend Image
id: build-frontend-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.DOCKER_IMAGE_NAME_FRONTEND }}
tags: ${{ needs.get-distros.outputs.tags }}
platforms: linux/arm/v7, linux/arm64/v8, linux/amd64, linux/arm64
containerfiles: |
./docker/Dockerfile-frontend