fix: Dockerfile, entrypoint, and CI for multi-repo deployment
Some checks failed
Build and Deploy / build-and-deploy (push) Has been cancelled

- Fix requirements.txt path to shared_lib/requirements.txt
- Guard alembic migrations with RUN_MIGRATIONS env var
- Fix APP_MODULE default to app:app
- CI: add git submodule update, deploy shared coop stack from /root/coop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-10 00:14:01 +00:00
parent 0586fe79cf
commit f367aa584f
3 changed files with 18 additions and 13 deletions

View File

@@ -7,6 +7,7 @@ on:
env:
REGISTRY: registry.rose-ash.com:5000
IMAGE: blog
REPO_DIR: /root/blog
jobs:
build-and-deploy:
@@ -33,9 +34,10 @@ jobs:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
ssh "root@$DEPLOY_HOST" "
cd /root/blog
cd ${{ env.REPO_DIR }}
git fetch origin main
git reset --hard origin/main
git submodule update --init --recursive
"
- name: Build and push image
@@ -43,8 +45,10 @@ jobs:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
ssh "root@$DEPLOY_HOST" "
cd /root/blog
docker build --build-arg CACHEBUST=\$(date +%s) -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest -t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }} .
cd ${{ env.REPO_DIR }}
docker build --build-arg CACHEBUST=\$(date +%s) \
-t ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest \
-t ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }} .
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:latest
docker push ${{ env.REGISTRY }}/${{ env.IMAGE }}:${{ github.sha }}
"
@@ -54,10 +58,10 @@ jobs:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
ssh "root@$DEPLOY_HOST" "
cd /root/blog
cd /root/coop
source .env
docker stack deploy -c docker-compose.yml blog
docker stack deploy -c docker-compose.yml coop
echo 'Waiting for services to update...'
sleep 10
docker stack services blog
docker stack services coop
"