mirror of
https://github.com/kevinthedang/discord-ollama.git
synced 2025-12-12 11:56:06 -05:00
* add redis container * Updated Guides and Goals (#134) * Update README.md * Update commands-guide.md * Update events-guide.md * Update commands-guide.md * Added: redis client * Fixed: redis mock in commands.test.ts * Updated: npm package patches * Fixed: redis ip name in keys.ts * update Node LTS version, workflow env vars * Updated: node package engine requirements * Updated: documentation * fix: upgrade dotenv from 16.4.5 to 16.4.7 (#152) Snyk has created this PR to upgrade dotenv from 16.4.5 to 16.4.7. See this package in npm: dotenv See this project in Snyk: https://app.snyk.io/org/jt2m0l3y/project/d8b070a3-e4a3-457a-977b-7eb6a4a48346?utm_source=github&utm_medium=referral&page=upgrade-pr Co-authored-by: snyk-bot <snyk-bot@snyk.io> * Update: docs patches, connection ordering --------- Co-authored-by: snyk-bot <snyk-bot@snyk.io>
78 lines
2.4 KiB
YAML
78 lines
2.4 KiB
YAML
name: Builds
|
|
run-name: Validate Node and Docker Builds
|
|
on:
|
|
push:
|
|
branches:
|
|
- master # runs after Pull Request is merged
|
|
|
|
jobs:
|
|
Discord-Node-Build: # test if the node install and run
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node Environment lts/jod
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/jod
|
|
cache: "npm"
|
|
|
|
- name: Install Project Dependencies
|
|
run: |
|
|
npm install
|
|
|
|
- name: Build Application
|
|
run: |
|
|
npm run build
|
|
|
|
- name: Create Environment Variables
|
|
run: |
|
|
touch .env
|
|
echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env
|
|
echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env
|
|
echo OLLAMA_PORT = ${{ secrets.OLLAMA_PORT }} >> .env
|
|
echo REDIS_IP = ${{ secrets.REDIS_IP }} >> .env
|
|
echo REDIS_PORT = ${{ secrets.REDIS_PORT }} >> .env
|
|
|
|
# set -e ensures if nohup fails, this section fails
|
|
- name: Startup Discord Bot Client
|
|
run: |
|
|
set -e
|
|
nohup npm run prod &
|
|
|
|
Discord-Ollama-Container-Build: # test docker build and run
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 2
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Node Environment lts/jod
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/jod
|
|
cache: "npm"
|
|
|
|
- name: Create Environment Variables
|
|
run: |
|
|
touch .env
|
|
echo CLIENT_TOKEN = ${{ secrets.BOT_TOKEN }} >> .env
|
|
echo OLLAMA_IP = ${{ secrets.OLLAMA_IP }} >> .env
|
|
echo OLLAMA_PORT = ${{ secrets.OLLAMA_PORT }} >> .env
|
|
echo REDIS_IP = ${{ secrets.REDIS_IP }} >> .env
|
|
echo REDIS_PORT = ${{ secrets.REDIS_PORT }} >> .env
|
|
|
|
- name: Setup Docker Network and Images
|
|
run: |
|
|
npm run docker:start-cpu
|
|
|
|
- name: Check Images Exist
|
|
run: |
|
|
(docker images | grep -q 'kevinthedang/discord-ollama' && docker images | grep -qE 'ollama/ollama' | docker images | grep -qE 'redis') || exit 1
|
|
|
|
- name: Check Containers Exist
|
|
run: |
|
|
(docker ps | grep -q 'ollama' && docker ps | grep -q 'discord' && docker ps | grep -q 'redis') || exit 1
|