diff --git a/.dockerignore b/.dockerignore index b512c09..bb7f969 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ -node_modules \ No newline at end of file +node_modules +db +.git \ No newline at end of file diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml new file mode 100644 index 0000000..8eff018 --- /dev/null +++ b/.forgejo/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy Cletus Bot + +on: + push: + branches: [ main ] + +jobs: + deploy: + runs-on: docker + steps: + - name: 📥 Checkout code + uses: actions/checkout@v3 + + - name: 🐢 Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: 📦 Install dependencies + run: npm install + + - name: 🧱 Build and Deploy with Compose + run: | + docker compose down || true + docker compose up -d --build + + - name: 📄 Show logs + run: docker logs --since 10s cletus-bot diff --git a/.gitignore b/.gitignore index 059573d..476c891 100644 --- a/.gitignore +++ b/.gitignore @@ -91,10 +91,14 @@ fabric.properties # Android studio 3.1+ serialized cache file .idea/caches/build_file_checksums.ser +<<<<<<< Updated upstream # Node/npm node_modules/ npm-debug.log .DS_Store .env dist/ -coverage/ \ No newline at end of file +coverage/ +======= +bot/db/ +>>>>>>> Stashed changes diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f79547b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3.8' + +services: + cletus-bot: + container_name: cletus-bot + build: + context: . + dockerfile: Dockerfile + platforms: + - linux/amd64 + image: cletus-bot + restart: unless-stopped + volumes: + - ./bot/db:/app/bot/db + - ./bot/bot-tasks:/app/bot/bot-tasks + stdin_open: true + tty: true