Adds solvway-services-whatsapp with per-company WhatsApp settings (secrets masked), the gateway route /whatsapp/**, compose entries for the service and a local whatsapp-mock, the example env keys, and the service in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
79 lines
2.9 KiB
YAML
79 lines
2.9 KiB
YAML
name: CI
|
|
|
|
# Builds and tests every module, then publishes nine images to gitea.containerverse.dev/solvway/co-lite-<module>,
|
|
# tagged with the commit SHA and latest (openspec spec release-packaging). Nothing is pushed unless every build,
|
|
# test and image check passes. Deployment is done outside this workflow.
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
# Two quick pushes to main must not interleave their image pushes or latest tags.
|
|
concurrency:
|
|
group: co-lite-main
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
container:
|
|
image: gitea.containerverse.dev/solvway/maven-custom-21:latest
|
|
credentials:
|
|
username: ${{ secrets.PACKAGE_USER }}
|
|
password: ${{ secrets.PACKAGE_RW_KEY }}
|
|
volumes:
|
|
- /cache/m2:/root/.m2
|
|
env:
|
|
REGISTRY: gitea.containerverse.dev
|
|
IMAGE_PREFIX: gitea.containerverse.dev/solvway/co-lite-
|
|
DOCKER_HOST: tcp://docker:2375
|
|
DOCKER_TLS_VERIFY: ""
|
|
# image name : module folder
|
|
IMAGES: >-
|
|
api-gateway:solvway-api-gateway
|
|
mobile-api:solvway-mobile-api
|
|
service-auth:solvway-services-auth
|
|
service-system:solvway-services-system
|
|
service-counter:solvway-services-counter
|
|
service-member:solvway-services-member
|
|
service-log:solvway-services-log
|
|
service-email:solvway-services-email
|
|
service-whatsapp:solvway-services-whatsapp
|
|
admin-portal:solvway-admin-portal
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and test the services
|
|
run: |
|
|
mvn -T 1C -B -Dmaven.repo.local=/root/.m2/repository-co-lite verify \
|
|
-pl solvway-api-gateway,solvway-mobile-api,solvway-services-auth,solvway-services-system,solvway-services-counter,solvway-services-member,solvway-services-log,solvway-services-email,solvway-services-whatsapp -am
|
|
|
|
- name: Registry login
|
|
env:
|
|
REGISTRY_USER: ${{ secrets.PACKAGE_USER }}
|
|
REGISTRY_KEY: ${{ secrets.PACKAGE_RW_KEY }}
|
|
run: printf '%s' "$REGISTRY_KEY" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin
|
|
|
|
- name: Build and check every image
|
|
# The admin portal's Dockerfile runs its own tests and lint; a red suite fails its build.
|
|
run: |
|
|
# image-check.sh needs unzip and refuses to run without it.
|
|
command -v unzip >/dev/null || { apt-get update -qq && apt-get install -y -qq unzip; }
|
|
for pair in $IMAGES; do
|
|
name=${pair%%:*}; dir=${pair#*:}
|
|
docker build -t "$IMAGE_PREFIX$name:$GITHUB_SHA" -t "$IMAGE_PREFIX$name:latest" "$dir"
|
|
sh local/image-check.sh "$IMAGE_PREFIX$name:$GITHUB_SHA"
|
|
done
|
|
|
|
- name: Push every image
|
|
run: |
|
|
for pair in $IMAGES; do
|
|
name=${pair%%:*}
|
|
docker push "$IMAGE_PREFIX$name:$GITHUB_SHA"
|
|
docker push "$IMAGE_PREFIX$name:latest"
|
|
done
|