Feature/ci container (#15)
CI Main / Load example-gitea-env.conf to pipeline env (push) Successful in 19s
CI Main / Check existing artifact (push) Successful in 14s
unit-tests Link to Bats reports
CI Main / Bats tests (push) Successful in 1m43s
acc-tests Link to Cucumber reports
CI Main / Cucumber tests (push) Successful in 1m9s
ci-docker-build-push Docker build & push 0.2.4 OK
CI Main / Build & Push Docker (push) Successful in 37s
CI Main / Report Summary (push) Successful in 5s
CI Main / Move provider version tag (push) Successful in 13s

Co-authored-by: moilanik <niko.moilanen@tietoevry.com>
Reviewed-on: #15
This commit was merged in pull request #15.
This commit is contained in:
2026-06-16 09:13:36 +03:00
parent dd9ad9e2c8
commit 8622b6fc4e
11 changed files with 114 additions and 6 deletions
@@ -0,0 +1,57 @@
name: CI Container Build & Push
on:
workflow_call:
inputs:
env_json:
required: true
type: string
dockerfile_path:
required: true
type: string
image_name:
required: true
type: string
tag:
required: true
type: string
secrets:
DOCKER_USERNAME:
required: false
DOCKER_PASSWORD:
required: true
env:
DOCKER_REGISTRY: ${{ fromJson(inputs.env_json).DOCKER_REGISTRY || '' }}
IMAGE_NAME: ${{ inputs.image_name }}
TAG: ${{ inputs.tag }}
DOCKERFILE: ${{ inputs.dockerfile_path }}
jobs:
build-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build and push CI container
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME || github.actor }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
docker build \
--label "git.commit=${{ github.sha }}" \
--label "git.commitBy=${{ github.actor }}" \
--label "build.date=${NOW}" \
-f "${DOCKERFILE}" \
-t "${IMAGE_NAME}:${TAG}" .
REGISTRY="${DOCKER_REGISTRY:?DOCKER_REGISTRY not set in env.conf}"
REGISTRY_HOST="${REGISTRY%%/*}"
FULL_IMAGE="${REGISTRY}/${IMAGE_NAME}:${TAG}"
echo "Pushing ${FULL_IMAGE} ..."
docker tag "${IMAGE_NAME}:${TAG}" "$FULL_IMAGE"
echo "$DOCKER_PASSWORD" | docker login "$REGISTRY_HOST" -u "$DOCKER_USERNAME" --password-stdin
docker push "$FULL_IMAGE"
docker logout "$REGISTRY_HOST"
@@ -0,0 +1,21 @@
name: Build CI Bats Container (Manual)
on: workflow_dispatch
jobs:
load-config:
name: Load config
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
secrets: inherit
with:
config_path: .gitea/workflows/example-gitea-env.conf
build-push:
name: Build & Push
needs: [load-config]
uses: niko/gitea-ci-library/.gitea/workflows/ci-container-build-push.yml@main
secrets: inherit
with:
env_json: ${{ needs.load-config.outputs.env_json }}
dockerfile_path: Dockerfile.ci-bats
image_name: ci-bats
tag: latest
@@ -0,0 +1,21 @@
name: Build CI Cucumber Container (Manual)
on: workflow_dispatch
jobs:
load-config:
name: Load config
uses: niko/gitea-ci-library/.gitea/workflows/config-provider.yml@main
secrets: inherit
with:
config_path: .gitea/workflows/example-gitea-env.conf
build-push:
name: Build & Push
needs: [load-config]
uses: niko/gitea-ci-library/.gitea/workflows/ci-container-build-push.yml@main
secrets: inherit
with:
env_json: ${{ needs.load-config.outputs.env_json }}
dockerfile_path: Dockerfile.ci-cucumber
image_name: ci-cucumber
tag: latest
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
name: Report Summary
needs: [load-config, bats, cucumber]
if: always()
uses: niko/gitea-ci-library/.gitea/workflows/example-report-summary.yml@main
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
with:
env_json: ${{ needs.load-config.outputs.env_json }}
suites: bats cucumber
+1 -1
View File
@@ -55,7 +55,7 @@ jobs:
name: Report Summary
needs: [load-config, build-push]
if: always()
uses: niko/gitea-ci-library/.gitea/workflows/example-report-summary.yml@main
uses: niko/gitea-ci-library/.gitea/workflows/report-summary.yml@main
with:
env_json: ${{ needs.load-config.outputs.env_json }}
suites: bats cucumber