fix: sync CI/CD fixes from dev to main
Some checks failed
Deploy Bot on NAS / deploy (push) Failing after 2s

This commit is contained in:
Elewyn 2026-04-30 16:42:57 +02:00
parent 6fc1f39b86
commit cf6f68c31c
2 changed files with 14 additions and 18 deletions

View file

@ -8,8 +8,13 @@ jobs:
deploy: deploy:
runs-on: self-hosted runs-on: self-hosted
steps: steps:
- name: Install dependencies
run: apk add --no-cache rsync openssh-client
- name: Checkout - name: Checkout
uses: actions/checkout@v4 run: |
git clone --depth 1 --branch ${{ github.ref_name }} \
${{ github.server_url }}/${{ github.repository }}.git .
- name: Set deployment path - name: Set deployment path
run: | run: |
@ -23,29 +28,23 @@ jobs:
- name: Configure SSH - name: Configure SSH
run: | run: |
mkdir -p ~/.ssh mkdir -p /root/.ssh
echo "${{ secrets.NAS_SSH_KEY }}" > ~/.ssh/id_deploy echo "${{ secrets.NAS_SSH_KEY }}" > /root/.ssh/id_deploy
chmod 600 ~/.ssh/id_deploy chmod 600 /root/.ssh/id_deploy
cat >> ~/.ssh/config << 'EOF'
Host nas
HostName 192.168.1.208
User Elewyn
IdentityFile ~/.ssh/id_deploy
StrictHostKeyChecking no
EOF
- name: Sync files to NAS - name: Sync files to NAS
run: | run: |
rsync -av --delete \ rsync -av --delete \
-e "ssh -i /root/.ssh/id_deploy -o StrictHostKeyChecking=no" \
--exclude='.git' \ --exclude='.git' \
--exclude='.env' \ --exclude='.env' \
--exclude='data/' \ --exclude='data/' \
--exclude='screenshots/' \ --exclude='screenshots/' \
--exclude='logs/' \ --exclude='logs/' \
./ nas:${{ env.DEPLOY_PATH }}/ ./ Elewyn@192.168.1.208:${{ env.DEPLOY_PATH }}/
- name: Restart bot on NAS - name: Restart bot on NAS
run: | run: |
ssh nas "cd ${{ env.DEPLOY_PATH }} && \ ssh -i /root/.ssh/id_deploy -o StrictHostKeyChecking=no \
docker compose down || true && \ Elewyn@192.168.1.208 \
docker compose up --build -d" "cd ${{ env.DEPLOY_PATH }} && /share/CACHEDEV1_DATA/.qpkg/container-station/usr/bin/docker compose down || true && /share/CACHEDEV1_DATA/.qpkg/container-station/usr/bin/docker compose up -d"

View file

@ -1,5 +1,3 @@
version: '3.8'
services: services:
discord-bot: discord-bot:
build: . build: .
@ -15,7 +13,6 @@ services:
- ./logs:/app/logs - ./logs:/app/logs
environment: environment:
- TZ=Europe/Paris - TZ=Europe/Paris
container_name: rtf-discord-bot
deploy: deploy:
resources: resources:
limits: limits: