mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:21:10 +02:00
🚀 ci: add mana-search and api-gateway to Docker builds
- Add mana-search + SearXNG to docker-compose.macmini.yml - Add api-gateway dependency on mana-search - Add CI workflow for building mana-search Docker image - Add CI workflow for building api-gateway Docker image
This commit is contained in:
parent
4c1beb9534
commit
271496b0fd
55 changed files with 403 additions and 280 deletions
82
.github/workflows/ci.yml
vendored
82
.github/workflows/ci.yml
vendored
|
|
@ -50,6 +50,8 @@ jobs:
|
|||
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||
outputs:
|
||||
mana-core-auth: ${{ steps.changes.outputs.mana-core-auth }}
|
||||
mana-search: ${{ steps.changes.outputs.mana-search }}
|
||||
api-gateway: ${{ steps.changes.outputs.api-gateway }}
|
||||
manacore-web: ${{ steps.changes.outputs.manacore-web }}
|
||||
chat-backend: ${{ steps.changes.outputs.chat-backend }}
|
||||
chat-web: ${{ steps.changes.outputs.chat-web }}
|
||||
|
|
@ -84,6 +86,8 @@ jobs:
|
|||
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ inputs.force_build_all }}" == "true" ]; then
|
||||
echo "Force rebuild all services requested"
|
||||
echo "mana-core-auth=true" >> $GITHUB_OUTPUT
|
||||
echo "mana-search=true" >> $GITHUB_OUTPUT
|
||||
echo "api-gateway=true" >> $GITHUB_OUTPUT
|
||||
echo "manacore-web=true" >> $GITHUB_OUTPUT
|
||||
echo "chat-backend=true" >> $GITHUB_OUTPUT
|
||||
echo "chat-web=true" >> $GITHUB_OUTPUT
|
||||
|
|
@ -122,6 +126,8 @@ jobs:
|
|||
# workflow_dispatch without force - build all
|
||||
echo "Workflow dispatch without force_build_all - building all"
|
||||
echo "mana-core-auth=true" >> $GITHUB_OUTPUT
|
||||
echo "mana-search=true" >> $GITHUB_OUTPUT
|
||||
echo "api-gateway=true" >> $GITHUB_OUTPUT
|
||||
echo "manacore-web=true" >> $GITHUB_OUTPUT
|
||||
echo "chat-backend=true" >> $GITHUB_OUTPUT
|
||||
echo "chat-web=true" >> $GITHUB_OUTPUT
|
||||
|
|
@ -181,6 +187,22 @@ jobs:
|
|||
echo "mana-core-auth=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# mana-search: services/mana-search
|
||||
SEARCH_CHANGED=$(check_pattern "services/mana-search/")
|
||||
if [ "$COMMON_CHANGED" == "true" ] || [ "$SEARCH_CHANGED" == "true" ]; then
|
||||
echo "mana-search=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "mana-search=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# api-gateway: services/mana-api-gateway + packages/shared-nestjs-auth
|
||||
GATEWAY_CHANGED=$(check_pattern "services/mana-api-gateway/|packages/shared-nestjs-auth/")
|
||||
if [ "$COMMON_CHANGED" == "true" ] || [ "$GATEWAY_CHANGED" == "true" ]; then
|
||||
echo "api-gateway=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "api-gateway=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# manacore-web: apps/manacore/apps/web + shared packages
|
||||
MANACORE_WEB_CHANGED=$(check_pattern "apps/manacore/apps/web/|apps/manacore/packages/")
|
||||
if [ "$COMMON_CHANGED" == "true" ] || [ "$SHARED_AUTH_CHANGED" == "true" ] || [ "$SHARED_UI_CHANGED" == "true" ] || [ "$SHARED_WEB_CHANGED" == "true" ] || [ "$MANACORE_WEB_CHANGED" == "true" ]; then
|
||||
|
|
@ -355,6 +377,8 @@ jobs:
|
|||
echo "| Service | Will Build |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "|---------|------------|" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| mana-core-auth | ${{ steps.changes.outputs.mana-core-auth }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| mana-search | ${{ steps.changes.outputs.mana-search }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| api-gateway | ${{ steps.changes.outputs.api-gateway }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| manacore-web | ${{ steps.changes.outputs.manacore-web }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| chat-backend | ${{ steps.changes.outputs.chat-backend }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| chat-web | ${{ steps.changes.outputs.chat-web }} |" >> $GITHUB_STEP_SUMMARY
|
||||
|
|
@ -443,6 +467,64 @@ jobs:
|
|||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-mana-search:
|
||||
name: Build mana-search
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-changes
|
||||
if: needs.detect-changes.outputs.mana-search == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository_owner }}/mana-search
|
||||
tags: type=raw,value=latest
|
||||
- uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: services/mana-search
|
||||
file: services/mana-search/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-api-gateway:
|
||||
name: Build api-gateway
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-changes
|
||||
if: needs.detect-changes.outputs.api-gateway == 'true'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: docker/setup-qemu-action@v3
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
- uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/metadata-action@v5
|
||||
id: meta
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository_owner }}/api-gateway
|
||||
tags: type=raw,value=latest
|
||||
- uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: services/mana-api-gateway/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-manacore-web:
|
||||
name: Build manacore-web
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue