Repository navigation
152 lines (130 loc) · 4.77 KB
/
Copy pathbuild-release.yml
File metadata and controls
152 lines (130 loc) · 4.77 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Create and publish release container images
on:
push:
tags:
- 'v*.*.*'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.x'
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: webui/package-lock.json
- name: Install Python test dependencies
run: pip install -r src/requirements.txt pytest pytest-cov
- name: Run Python unit tests
run: pytest tests/ -v --cov=src --cov-report=xml --cov-report=term-missing
- name: Install WebUI dependencies
working-directory: webui
run: npm ci
- name: Run WebUI tests with coverage
working-directory: webui
run: npm run test:coverage -- --run
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7
with:
files: coverage.xml,webui/coverage/lcov.info
flags: python,webui
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
build-and-push-images:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Log in to the Container registry
uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push dapi container (main Dockerfile)
- name: Extract metadata (tags, labels) for dapi container
id: meta-dapi
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push dapi image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc
with:
context: .
push: true
tags: ${{ steps.meta-dapi.outputs.tags }}
labels: ${{ steps.meta-dapi.outputs.labels }}
# Build and push WebUI container
- name: Extract metadata (tags, labels) for WebUI container
id: meta-webui
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-webui
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push WebUI image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc
with:
context: webui/.
push: true
tags: ${{ steps.meta-webui.outputs.tags }}
labels: ${{ steps.meta-webui.outputs.labels }}
# Build and push DevPortal container
- name: Extract metadata (tags, labels) for DevPortal container
id: meta-devportal
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-devportal
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push DevPortal image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc
with:
context: contrib/devportal/redocly/.
push: true
tags: ${{ steps.meta-devportal.outputs.tags }}
labels: ${{ steps.meta-devportal.outputs.labels }}
# Build and push MCP container
- name: Extract metadata (tags, labels) for MCP container
id: meta-mcp
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-mcp
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Build and push MCP image
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc
with:
context: contrib/mcp/.
push: true
tags: ${{ steps.meta-mcp.outputs.tags }}
labels: ${{ steps.meta-mcp.outputs.labels }}