feat: admin categorized display, improved CI/CD pipeline
- Admin: User timeline contributions shown in Timeline section - Admin: User memory contributions shown in Erinnerungen section - Admin: User photo uploads shown in Familien-Uploads section - All contributions still appear in unified Beiträge section - Dockerfile: fix data dir path (/data -> /app/data) - CI/CD: use checkout@v4, retry health check, auto-create proxy network - CI/CD: support SITE_PASSWORD/ADMIN_PASSWORD secrets - CI/CD: use wget instead of curl (alpine compat) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
+35
-19
@@ -8,23 +8,25 @@ on:
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Create proxy network if needed
|
||||
run: docker network create proxy || true
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t oma-memorial:latest .
|
||||
|
||||
run: docker build -t oma-memorial:latest .
|
||||
|
||||
- name: Stop and remove old container
|
||||
run: |
|
||||
docker stop oma-memorial || true
|
||||
docker rm oma-memorial || true
|
||||
|
||||
docker stop oma-memorial 2>/dev/null || true
|
||||
docker rm oma-memorial 2>/dev/null || true
|
||||
|
||||
- name: Ensure data directory exists
|
||||
run: mkdir -p ${{ gitea.workspace }}/data
|
||||
|
||||
- name: Run container in proxy network
|
||||
run: |
|
||||
docker run -d \
|
||||
@@ -32,14 +34,28 @@ jobs:
|
||||
--network proxy \
|
||||
--restart unless-stopped \
|
||||
-e NODE_ENV=production \
|
||||
-v $(pwd)/data:/app/data \
|
||||
-e SITE_PASSWORD="${{ secrets.SITE_PASSWORD }}" \
|
||||
-e ADMIN_PASSWORD="${{ secrets.ADMIN_PASSWORD }}" \
|
||||
-v ${{ gitea.workspace }}/data:/app/data \
|
||||
oma-memorial:latest
|
||||
|
||||
|
||||
- name: Health check
|
||||
run: |
|
||||
sleep 10
|
||||
docker exec oma-memorial curl -f http://localhost:3000 || exit 1
|
||||
|
||||
- name: Show container logs
|
||||
echo "Waiting for container to start..."
|
||||
for i in $(seq 1 15); do
|
||||
if docker exec oma-memorial wget -q --spider http://localhost:3000 2>/dev/null; then
|
||||
echo "Container is healthy!"
|
||||
exit 0
|
||||
fi
|
||||
echo "Attempt $i/15..."
|
||||
sleep 2
|
||||
done
|
||||
echo "Health check failed"
|
||||
docker logs oma-memorial --tail 30
|
||||
exit 1
|
||||
|
||||
- name: Show container status
|
||||
if: always()
|
||||
run: docker logs oma-memorial --tail 50
|
||||
run: |
|
||||
docker ps --filter name=oma-memorial
|
||||
docker logs oma-memorial --tail 20
|
||||
|
||||
Reference in New Issue
Block a user