fix: update deployment workflow to use Docker image instead of build context
Deploy to NAS / deploy (push) Has been cancelled

This commit is contained in:
2025-12-24 21:03:57 -05:00
parent 2cee379491
commit 59590002b8
2 changed files with 15 additions and 20 deletions
+14 -17
View File
@@ -15,29 +15,27 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Generate package-lock.json - name: Generate package-lock.json
run: npm install run: npm ci --omit=dev
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build Docker image - name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: tea.kleptonix.com
username: ${{ secrets.TEA_USERNAME }}
password: ${{ secrets.TEA_TOKEN }}
- name: Build and Push Docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
push: false push: true
load: true tags: tea.kleptonix.com/hllywluis/kekbot.js:latest
tags: kekbot:latest
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
- name: Save Docker image
run: docker save kekbot:latest -o kekbot.tar
- name: Install SSH dependencies
run: |
sudo apt-get update
sudo apt-get install -y sshpass
- name: Generate .env file - name: Generate .env file
run: | run: |
cat > .env << EOF cat > .env << EOF
@@ -55,13 +53,12 @@ jobs:
sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no hllywluis@luis-nas.lan "mkdir -p /mnt/kCloud/Home/hllywluis/kekbot" sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no hllywluis@luis-nas.lan "mkdir -p /mnt/kCloud/Home/hllywluis/kekbot"
# Copy Docker files (without .env, it's generated separately) # Copy Docker files (without .env, it's generated separately)
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no docker-compose.yml Dockerfile kekbot.tar hllywluis@luis-nas.lan:/mnt/kCloud/Home/hllywluis/kekbot/ sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no docker-compose.yml .env hllywluis@luis-nas.lan:/mnt/kCloud/Home/hllywluis/kekbot/
sshpass -p "$SSH_PASSWORD" scp -o StrictHostKeyChecking=no .env hllywluis@luis-nas.lan:/mnt/kCloud/Home/hllywluis/kekbot/
# Load Docker image and deploy # Pull Docker image and deploy
sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no hllywluis@luis-nas.lan << 'EOF' sshpass -p "$SSH_PASSWORD" ssh -o StrictHostKeyChecking=no hllywluis@luis-nas.lan << 'EOF'
cd /mnt/kCloud/Home/hllywluis/kekbot cd /mnt/kCloud/Home/hllywluis/kekbot
docker load -i kekbot.tar
docker compose down || true docker compose down || true
docker pull tea.kleptonix.com/_/hllywluis/kekbot.js:latest
docker compose up -d docker compose up -d
EOF EOF
+1 -3
View File
@@ -2,9 +2,7 @@ version: '3.8'
services: services:
kekbot: kekbot:
build: image: tea.kleptonix.com/hllywluis/kekbot.js:latest
context: .
dockerfile: Dockerfile
container_name: kekbot container_name: kekbot
restart: unless-stopped restart: unless-stopped
env_file: env_file: