-
Notifications
You must be signed in to change notification settings - Fork 18
125 lines (105 loc) · 3.71 KB
/
Copy pathbuild-containers.yml
File metadata and controls
125 lines (105 loc) · 3.71 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
name: Create and publish container images
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python test dependencies
run: pip install pytest pyyaml pytest-cov
- name: Run Python unit tests
run: pytest tests/ -v --cov=src --cov-report=xml --cov-report=term-missing
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: webui/package-lock.json
- 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@v4
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@v6
- name: Log in to the Container registry
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
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@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=raw,value=latest
- name: Build and push dapi image
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf
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@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-webui
tags: |
type=sha
type=raw,value=latest
- name: Build and push WebUI image
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf
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@030e881283bb7a6894de51c315a6bfe6a94e05cf
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-devportal
tags: |
type=sha
type=raw,value=latest
- name: Build and push DevPortal image
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf
with:
context: contrib/devportal/redocly/.
push: true
tags: ${{ steps.meta-devportal.outputs.tags }}
labels: ${{ steps.meta-devportal.outputs.labels }}