ci: use docker run with correct volume path instead of compose file
Build & Deploy / build-and-deploy (push) Successful in 11s

The runner container can't access the compose file path on the host.
Use the compose file's parameters (network: dockernet, volume:
/mnt/cache/appdata/dostalgia) directly in docker run instead.
This commit is contained in:
David Alvarez
2026-06-08 11:10:46 +02:00
parent 9801e37bec
commit 82b379d211
+20 -14
View File
@@ -1,7 +1,7 @@
# This workflow builds and deploys Dostalgia whenever code is pushed to main.
# Uses docker-compose at /unraid/dostalgia/compose.yaml (mounted into the
# runner container from the host's /appdata/dockhand/stacks/unraid/dostalgia).
# Requires a Gitea Actions runner registered on the host with Docker socket access.
# The runner has Docker socket access so it can manage containers on the host.
# Parameters match the docker-compose at:
# /appdata/dockhand/stacks/unraid/dostalgia/compose.yaml
# See: https://docs.gitea.com/usage/actions
name: Build & Deploy
@@ -13,7 +13,8 @@ on:
env:
IMAGE_NAME: dostalgia
COMPOSE_DIR: /unraid/dostalgia
CONTAINER_NAME: dostalgia
DATA_VOLUME: /mnt/cache/appdata/dostalgia
jobs:
build-and-deploy:
@@ -28,27 +29,32 @@ jobs:
docker build -t ${{ env.IMAGE_NAME }}:${{ gitea.sha }} .
docker tag ${{ env.IMAGE_NAME }}:${{ gitea.sha }} ${{ env.IMAGE_NAME }}:latest
- name: Deploy via docker-compose
- name: Deploy container
run: |
cd "${{ env.COMPOSE_DIR }}"
docker compose up -d
docker stop ${{ env.CONTAINER_NAME }} 2>/dev/null || true
docker rm ${{ env.CONTAINER_NAME }} 2>/dev/null || true
docker run -d \
--name ${{ env.CONTAINER_NAME }} \
--restart unless-stopped \
--network dockernet \
-p 8765:8765/tcp \
-v ${{ env.DATA_VOLUME }}:/data \
-e TWITCH_CLIENT_ID='${{ secrets.TWITCH_CLIENT_ID }}' \
-e TWITCH_CLIENT_SECRET='${{ secrets.TWITCH_CLIENT_SECRET }}' \
${{ env.IMAGE_NAME }}:latest
- name: Verify container is running
run: |
sleep 5
CONTAINER_NAME=$(docker compose -f "${{ env.COMPOSE_DIR }}/compose.yaml" ps -q dostalgia 2>/dev/null || echo "dostalgia")
if [ -z "$CONTAINER_NAME" ] || [ "$CONTAINER_NAME" = "dostalgia" ]; then
CONTAINER_NAME="dostalgia"
fi
STATUS=$(docker inspect -f '{{.State.Status}}' "$CONTAINER_NAME" 2>/dev/null || docker inspect -f '{{.State.Status}}' dostalgia)
STATUS=$(docker inspect -f '{{.State.Status}}' ${{ env.CONTAINER_NAME }})
if [ "$STATUS" = "running" ]; then
echo "✅ Dostalgia container is running"
echo "--- last logs ---"
docker logs dostalgia --tail 5
docker logs ${{ env.CONTAINER_NAME }} --tail 5
echo "✅ Dostalgia deployed!"
else
echo "❌ Container status: $STATUS"
docker logs dostalgia --tail 30
docker logs ${{ env.CONTAINER_NAME }} --tail 30
exit 1
fi