-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (110 loc) · 3.53 KB
/
Copy pathbuild-containers.yaml
File metadata and controls
128 lines (110 loc) · 3.53 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build Experimental Containers
on:
push:
branches:
- experimenteel/samenwerken
workflow_dispatch:
env:
REGISTRY: ghcr.io
FRONTEND_IMAGE: ghcr.io/minbzk/par-dpia-form/dev/frontend
BACKEND_IMAGE: ghcr.io/minbzk/par-dpia-form/dev/backend
jobs:
generate-sources:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
- name: Install Python dependencies
run: pip install pyyaml jsonschema
- name: Generate JSON from YAML definitions
run: |
mkdir -p sources/generated
python script/run_all.py \
--schema schemas/assessment-definition.v1.schema.json \
--source sources/prescan_dpia.yaml \
--begrippen-yaml sources/begrippenkader_dpia.yaml \
--output-json sources/generated/PreScanDPIA.json \
--output-md docs/questions/questions_prescan_DPIA.md
python script/run_all.py \
--schema schemas/assessment-definition.v1.schema.json \
--source sources/dpia.yaml \
--begrippen-yaml sources/begrippenkader_dpia.yaml \
--output-json sources/generated/DPIA.json \
--output-md docs/questions/questions_DPIA.md
- name: Upload generated sources
uses: actions/upload-artifact@v4
with:
name: generated-sources
path: sources/generated/
retention-days: 1
build-backend:
needs: generate-sources
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v5
- name: Download generated sources
uses: actions/download-artifact@v4
with:
name: generated-sources
path: sources/generated/
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.BACKEND_IMAGE }}
tags: |
type=sha,prefix=
type=raw,value=latest
- name: Build and push backend
uses: docker/build-push-action@v6
with:
context: .
file: containers/backend/Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-frontend:
needs: generate-sources
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v5
- name: Download generated sources
uses: actions/download-artifact@v4
with:
name: generated-sources
path: sources/generated/
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.FRONTEND_IMAGE }}
tags: |
type=sha,prefix=
type=raw,value=latest
- name: Build and push frontend
uses: docker/build-push-action@v6
with:
context: .
file: containers/frontend/Containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}