Skip to content

Commit 492fb5a

Browse files
committed
add eio deployment github workflow
1 parent b68925d commit 492fb5a

2 files changed

Lines changed: 24 additions & 29 deletions

File tree

.github/workflows/main.yml

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: ci
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches: [eio, eio-prod]
6+
67

78
jobs:
89
test:
910
runs-on: ubuntu-24.04
1011

1112
strategy:
1213
matrix:
13-
base_image: ["ubuntu:noble", "debian:bookworm"]
14+
base_image: ["ubuntu:noble"]
1415

1516
steps:
1617
- uses: actions/checkout@v2
@@ -19,35 +20,27 @@ jobs:
1920
run: |
2021
mount | grep cgroup
2122
22-
- name: Build docker image
23+
- name: Set up docker buildx
24+
uses: docker/setup-buildx-action@v3
25+
26+
- name: Login to docker
27+
run: |
28+
docker login --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
29+
30+
- name: Build and push docker image
2331
run: |
24-
docker compose -p cms -f docker/docker-compose.test.yml build \
25-
--build-arg BASE_IMAGE=${{ matrix.base_image }} testcms
32+
if [ "$GITHUB_REF_NAME" = "eio-prod" ]; then
33+
TAGNAME=prod
34+
else
35+
TAGNAME=test
36+
fi
37+
docker buildx build --load --push -t ghcr.io/e-i-o/cms:$TAGNAME . \
38+
--cache-from type=registry,ref=ghcr.io/e-i-o/cms:build-cache \
39+
--cache-to type=registry,ref=ghcr.io/e-i-o/cms:build-cache \
40+
--build-arg BASE_IMAGE=${{ matrix.base_image }}
41+
docker tag ghcr.io/e-i-o/cms:$TAGNAME cms-testcms
2642
2743
- name: Run tests
2844
run: |
2945
docker compose -p cms -f docker/docker-compose.test.yml run --rm testcms
3046
31-
- name: Upload test results to Codecov
32-
if: ${{ !cancelled() }}
33-
uses: codecov/test-results-action@v1
34-
with:
35-
files: ./codecov/junit.xml
36-
flags: unittests
37-
token: ${{ secrets.CODECOV_TOKEN }}
38-
39-
- name: Upload unit test coverage results to Codecov
40-
uses: codecov/codecov-action@v4
41-
if: ${{ !cancelled() }}
42-
with:
43-
files: ./codecov/unittests.xml
44-
flags: unittests
45-
token: ${{ secrets.CODECOV_TOKEN }}
46-
47-
- name: Upload functional test coverage results to Codecov
48-
uses: codecov/codecov-action@v4
49-
if: ${{ !cancelled() }}
50-
with:
51-
files: ./codecov/functionaltests.xml
52-
flags: functionaltests
53-
token: ${{ secrets.CODECOV_TOKEN }}

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
ARG BASE_IMAGE=ubuntu:noble
44
FROM ${BASE_IMAGE}
55

6+
LABEL org.opencontainers.image.source=https://github.com/e-i-o/cms
7+
68
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
79
--mount=type=cache,target=/var/lib/apt,sharing=locked <<EOF
810
#!/bin/bash -ex

0 commit comments

Comments
 (0)