Fix: Deploy via Docker-Socket statt SSH
Runner laeuft auf adriahub - nutzt Docker-Socket direkt. Secrets (Discord Tokens, Admin PWD) als CI-Variablen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0301ace4a0
commit
8bfc2b1b0a
1 changed files with 30 additions and 7 deletions
|
|
@ -65,14 +65,37 @@ docker-build:
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
image: alpine:latest
|
image: docker:latest
|
||||||
needs: [docker-build]
|
needs: [docker-build]
|
||||||
rules:
|
rules:
|
||||||
- if: $CI_COMMIT_BRANCH == "main"
|
- if: $CI_COMMIT_BRANCH == "main"
|
||||||
before_script:
|
variables:
|
||||||
- apk add --no-cache openssh-client
|
DEPLOY_IMAGE: "git.adriahub.de/root/gaming-hub:latest"
|
||||||
- mkdir -p ~/.ssh
|
CONTAINER_NAME: "gaming-hub"
|
||||||
- echo "$DEPLOY_SSH_KEY" | base64 -d > /tmp/deploy_key
|
|
||||||
- chmod 600 /tmp/deploy_key
|
|
||||||
script:
|
script:
|
||||||
- ssh -i /tmp/deploy_key -o StrictHostKeyChecking=no root@100.79.45.50 "/mnt/cache/appdata/gaming-hub/deploy.sh"
|
- echo "[Deploy] Pulling $DEPLOY_IMAGE..."
|
||||||
|
- docker pull "$DEPLOY_IMAGE"
|
||||||
|
- echo "[Deploy] Stopping $CONTAINER_NAME..."
|
||||||
|
- docker stop "$CONTAINER_NAME" || true
|
||||||
|
- docker rm "$CONTAINER_NAME" || true
|
||||||
|
- echo "[Deploy] Starting $CONTAINER_NAME..."
|
||||||
|
- |
|
||||||
|
docker run -d \
|
||||||
|
--name "$CONTAINER_NAME" \
|
||||||
|
--network pangolin \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p 8085:8080 \
|
||||||
|
-e TZ=Europe/Berlin \
|
||||||
|
-e NODE_ENV=production \
|
||||||
|
-e PORT=8080 \
|
||||||
|
-e DATA_DIR=/data \
|
||||||
|
-e SOUNDS_DIR=/data/sounds \
|
||||||
|
-e "NODE_OPTIONS=--dns-result-order=ipv4first" \
|
||||||
|
-e ADMIN_PWD="$GAMING_HUB_ADMIN_PWD" \
|
||||||
|
-e PCM_CACHE_MAX_MB=2048 \
|
||||||
|
-e DISCORD_TOKEN_JUKEBOX="$GAMING_HUB_DISCORD_JUKEBOX" \
|
||||||
|
-e DISCORD_TOKEN_RADIO="$GAMING_HUB_DISCORD_RADIO" \
|
||||||
|
-v /mnt/cache/appdata/gaming-hub/data:/data:rw \
|
||||||
|
-v /mnt/cache/appdata/dockge/container/jukebox/sounds/:/data/sounds:rw \
|
||||||
|
"$DEPLOY_IMAGE"
|
||||||
|
- docker ps --filter name="$CONTAINER_NAME" --format "ID={{.ID}} Status={{.Status}} Image={{.Image}}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue