fix: Dockerfile 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
- 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:05 +00:00
parent 1bab546dfc
commit e191b32888
2 changed files with 9 additions and 5 deletions

View File

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

View File

@@ -16,7 +16,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
postgresql-client \ postgresql-client \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY requirements.txt ./requirements.txt COPY shared_lib/requirements.txt ./requirements.txt
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY . . COPY . .