-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (85 loc) · 3.12 KB
/
deploy-docker-images.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
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
# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors
# SPDX-License-Identifier: CC0-1.0
name: Build & push images
on:
push:
pull_request:
branches: ["main"]
env:
registry: ghcr.io/dsd-dbs/capella-dockerimages/
images: capella/base capella/remote capella/ease capella/readonly
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install pre-commit
run: |-
python -m pip install pre-commit
- name: Run pre-commit
run: |-
pre-commit run --all-files
deploy-docker-images:
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
capella_version:
- "5.0.0"
- "5.2.0"
- "6.0.0"
- "6.1.0"
dropins:
- name: "without" # without dropins
dropins: ""
- name: "selected"
dropins: "CapellaXHTMLDocGen,DiagramStyler,PVMT,Filtering,Requirements,SubsystemTransition" # selected set of dropins
name: Capella ${{ matrix.capella_version }} with ${{ matrix.dropins.name }} dropins
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/[email protected]
with:
cache: pip
cache-dependency-path: ./pyproject.toml
python-version: "3.11"
- name: Login to github container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set outputs
id: tag
run: |
echo "branch=$(git rev-parse --abbrev-ref HEAD | sed 's/[^a-zA-Z0-9]/-/g')" >> "$GITHUB_OUTPUT"
echo "sha=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build
run: >
make ${{ env.images }}
CAPELLA_VERSIONS="${{ matrix.capella_version }}"
DOCKER_PREFIX="${{ env.registry }}"
CAPELLA_DOCKERIMAGES_REVISION="${{ steps.tag.outputs.branch }}"
CAPELLA_DROPINS="${{ matrix.dropins.dropins }}"
DOCKER_TAG_SCHEMA=${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }}
DOCKER_BUILD_FLAGS="--label git-short-sha=${{ steps.tag.outputs.sha }}"
- name: Install test dependencies
run: |
docker build $DOCKER_BUILD_ARGS -t local-git-server tests/local-git-server
pip install .
- name: Run pytest
run: >
DOCKER_PREFIX="${{ env.registry }}"
DOCKER_TAG="${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }}"
CAPELLA_VERSION="${{ matrix.capella_version }}"
LOCAL_GIT_TAG="latest"
pytest -m "not (t4c_server or t4c)" tests
- name: Push
run: |
for image in ${{ env.images }}
do docker push "${{ env.registry }}$image:${{ matrix.capella_version }}-${{ matrix.dropins.name }}-dropins-${{ steps.tag.outputs.branch }}"
done