Fixed workflow and Dockerfile/Compose.
Some checks failed
Deploy Cletus Bot / deploy (push) Failing after 10s
Some checks failed
Deploy Cletus Bot / deploy (push) Failing after 10s
This commit is contained in:
parent
4aacdd45ce
commit
c30193da85
3 changed files with 19 additions and 15 deletions
|
|
@ -8,21 +8,26 @@ jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 📥 Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: 🐢 Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version: 20
|
||||||
|
|
||||||
- name: 📦 Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
||||||
- name: 🧱 Build and Deploy with Compose
|
- name: Copy config to deployment path
|
||||||
|
run: |
|
||||||
|
echo "Copying config.json to deployment folder..."
|
||||||
|
cp ./bot/config.json /mnt/user/game-servers/cletus/config.json
|
||||||
|
|
||||||
|
- name: Build and Deploy with Compose
|
||||||
run: |
|
run: |
|
||||||
docker compose down || true
|
docker compose down || true
|
||||||
docker compose up -d --build
|
docker compose up -d --build
|
||||||
|
|
||||||
- name: 📄 Show logs
|
- name: Show logs
|
||||||
run: docker logs --since 10s cletus-bot
|
run: docker logs --since 10s cletus-bot
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
FROM node:20
|
FROM node:20
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy dependency info and install
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Copy the rest of the app (including bot/ directory)
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Set working dir to bot folder
|
|
||||||
WORKDIR /app/bot
|
WORKDIR /app/bot
|
||||||
|
|
||||||
|
|
||||||
|
ENTRYPOINT ["bash", "-c"]
|
||||||
|
|
||||||
CMD ["node", "bot.js"]
|
CMD ["node", "bot.js"]
|
||||||
|
|
@ -2,7 +2,6 @@ version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
cletus-bot:
|
cletus-bot:
|
||||||
network_mode: host
|
|
||||||
container_name: cletus-bot
|
container_name: cletus-bot
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
|
@ -11,9 +10,9 @@ services:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
image: cletus-bot
|
image: cletus-bot
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
|
||||||
- ./bot/db:/app/bot/db
|
|
||||||
- ./bot/bot-tasks:/app/bot/bot-tasks
|
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
|
volumes:
|
||||||
|
- /mnt/user/game-servers/cletus/db:/app/bot/db
|
||||||
|
- /mnt/user/game-servers/cletus/bot-tasks:/app/bot/bot-tasks
|
||||||
|
- /mnt/user/game-servers/cletus/config.json:/app/bot/config.json
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue