mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 19:41:09 +02:00
🚀 feat(zitare): add Docker deployment infrastructure
- Add Dockerfile for zitare-backend (multi-stage build, port 3007) - Add docker-entrypoint.sh for database setup - Add zitare-backend service to docker-compose.macmini.yml - Update matrix-zitare-bot to depend on zitare-backend - Add zitare-backend to CI workflow (change detection + build job)
This commit is contained in:
parent
ab15c2367b
commit
c54ff859d6
4 changed files with 196 additions and 0 deletions
45
.github/workflows/ci.yml
vendored
45
.github/workflows/ci.yml
vendored
|
|
@ -82,6 +82,7 @@ jobs:
|
|||
matrix-zitare-bot: ${{ steps.changes.outputs.matrix-zitare-bot }}
|
||||
matrix-clock-bot: ${{ steps.changes.outputs.matrix-clock-bot }}
|
||||
matrix-tts-bot: ${{ steps.changes.outputs.matrix-tts-bot }}
|
||||
zitare-backend: ${{ steps.changes.outputs.zitare-backend }}
|
||||
any-changes: ${{ steps.changes.outputs.any-changes }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
|
|
@ -128,6 +129,7 @@ jobs:
|
|||
echo "matrix-zitare-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "matrix-clock-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "matrix-tts-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "zitare-backend=true" >> $GITHUB_OUTPUT
|
||||
echo "any-changes=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
|
@ -178,6 +180,7 @@ jobs:
|
|||
echo "matrix-zitare-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "matrix-clock-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "matrix-tts-bot=true" >> $GITHUB_OUTPUT
|
||||
echo "zitare-backend=true" >> $GITHUB_OUTPUT
|
||||
echo "any-changes=true" >> $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
|
@ -477,6 +480,14 @@ jobs:
|
|||
echo "matrix-tts-bot=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# zitare-backend
|
||||
ZITARE_BACKEND_CHANGED=$(check_pattern "apps/zitare/apps/backend/|apps/zitare/packages/")
|
||||
if [ "$COMMON_CHANGED" == "true" ] || [ "$SHARED_AUTH_CHANGED" == "true" ] || [ "$ZITARE_BACKEND_CHANGED" == "true" ]; then
|
||||
echo "zitare-backend=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "zitare-backend=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
# Check if any service needs building
|
||||
if grep -q "=true" $GITHUB_OUTPUT; then
|
||||
echo "any-changes=true" >> $GITHUB_OUTPUT
|
||||
|
|
@ -523,6 +534,7 @@ jobs:
|
|||
echo "| matrix-zitare-bot | ${{ steps.changes.outputs.matrix-zitare-bot }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| matrix-clock-bot | ${{ steps.changes.outputs.matrix-clock-bot }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| matrix-tts-bot | ${{ steps.changes.outputs.matrix-tts-bot }} |" >> $GITHUB_STEP_SUMMARY
|
||||
echo "| zitare-backend | ${{ steps.changes.outputs.zitare-backend }} |" >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
# ===========================================
|
||||
# Validation job - runs on PRs
|
||||
|
|
@ -1553,3 +1565,36 @@ jobs:
|
|||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
# ===========================================
|
||||
# Zitare Backend
|
||||
# ===========================================
|
||||
|
||||
build-zitare-backend:
|
||||
name: Build zitare-backend
|
||||
runs-on: ubuntu-latest
|
||||
needs: detect-changes
|
||||
if: needs.detect-changes.outputs.zitare-backend == '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 }}/zitare-backend
|
||||
tags: type=raw,value=latest
|
||||
- uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: apps/zitare/apps/backend/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue