Skip to content

Commit

Permalink
overhaul, update deps, add multi bot support
Browse files Browse the repository at this point in the history
  • Loading branch information
unclamped committed Nov 12, 2023
1 parent a4c5c6e commit 5c8317e
Show file tree
Hide file tree
Showing 8 changed files with 592 additions and 567 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: unclamped/bot-status

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Base image
FROM node:18-alpine
FROM node:20-alpine

# Install pnpm
RUN npm install -g pnpm
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ A Discord.JS bot that displays information about a game server on its status
1. Rename the `.env.sample` file to `.env`
2. Modify the `.env` file to your needs
- This applies for both Docker and non-Docker installations, since Docker automatically parses `.env` files
If you want to run more than one bot at once, you should add each bot's settings, with their variable name followed by a _ and the number that follows the previous bot setting.

### Settings
- Available settings:
Expand Down
12 changes: 6 additions & 6 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
context: .
restart: unless-stopped
environment:
- TOKEN=${TOKEN}
- IP=${IP}
- PORT=${PORT}
- DELAY=${DELAY}
- GAME=${GAME}
- ACTIVITY=${ACTIVITY}
- TOKEN_1=${TOKEN_1}
- IP_1=${IP_1}
- PORT_1=${PORT_1}
- DELAY_1=${DELAY_1}
- GAME_1=${GAME_1}
- ACTIVITY_1=${ACTIVITY_1}
24 changes: 10 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@
"lint:fix": "eslint . --ext .ts --fix"
},
"dependencies": {
"@tsconfig/node18": "^1.0.1",
"@tsconfig/strictest": "^1.0.2",
"discord.js": "^14.8.0",
"dotenv": "^16.0.3",
"gamedig": "^4.0.6",
"typescript": "^5.0.2",
"@types/gamedig": "^4.0.1",
"@types/node": "^18.15.5"
"discord.js": "^14.13.0",
"dotenv": "^16.3.1",
"gamedig": "^4.1.0"
},
"devDependencies": {
"@types/gamedig": "^4.0.1",
"@types/node": "^18.15.5",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"eslint": "^8.36.0",
"typescript": "^5.0.2"
"@tsconfig/node20": "^20.1.2",
"@types/gamedig": "^4.0.5",
"@types/node": "^18.18.9",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.53.0",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 5c8317e

Please sign in to comment.