fix: sync CI/CD fixes from dev to main
Some checks failed
Deploy Bot on NAS / deploy (push) Failing after 2s
Some checks failed
Deploy Bot on NAS / deploy (push) Failing after 2s
This commit is contained in:
parent
6fc1f39b86
commit
cf6f68c31c
2 changed files with 14 additions and 18 deletions
|
|
@ -8,8 +8,13 @@ jobs:
|
|||
deploy:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: apk add --no-cache rsync openssh-client
|
||||
|
||||
- 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
|
||||
run: |
|
||||
|
|
@ -23,29 +28,23 @@ jobs:
|
|||
|
||||
- name: Configure SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.NAS_SSH_KEY }}" > ~/.ssh/id_deploy
|
||||
chmod 600 ~/.ssh/id_deploy
|
||||
cat >> ~/.ssh/config << 'EOF'
|
||||
Host nas
|
||||
HostName 192.168.1.208
|
||||
User Elewyn
|
||||
IdentityFile ~/.ssh/id_deploy
|
||||
StrictHostKeyChecking no
|
||||
EOF
|
||||
mkdir -p /root/.ssh
|
||||
echo "${{ secrets.NAS_SSH_KEY }}" > /root/.ssh/id_deploy
|
||||
chmod 600 /root/.ssh/id_deploy
|
||||
|
||||
- name: Sync files to NAS
|
||||
run: |
|
||||
rsync -av --delete \
|
||||
-e "ssh -i /root/.ssh/id_deploy -o StrictHostKeyChecking=no" \
|
||||
--exclude='.git' \
|
||||
--exclude='.env' \
|
||||
--exclude='data/' \
|
||||
--exclude='screenshots/' \
|
||||
--exclude='logs/' \
|
||||
./ nas:${{ env.DEPLOY_PATH }}/
|
||||
./ Elewyn@192.168.1.208:${{ env.DEPLOY_PATH }}/
|
||||
|
||||
- name: Restart bot on NAS
|
||||
run: |
|
||||
ssh nas "cd ${{ env.DEPLOY_PATH }} && \
|
||||
docker compose down || true && \
|
||||
docker compose up --build -d"
|
||||
ssh -i /root/.ssh/id_deploy -o StrictHostKeyChecking=no \
|
||||
Elewyn@192.168.1.208 \
|
||||
"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"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
version: '3.8'
|
||||
|
||||
services:
|
||||
discord-bot:
|
||||
build: .
|
||||
|
|
@ -15,7 +13,6 @@ services:
|
|||
- ./logs:/app/logs
|
||||
environment:
|
||||
- TZ=Europe/Paris
|
||||
container_name: rtf-discord-bot
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
|
|
|
|||
Loading…
Reference in a new issue