6 Commits

Author SHA1 Message Date
4c628443c8 Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 7s
2025-12-24 00:08:39 +07:00
bbedb98ce0 Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 24s
2025-12-23 23:51:04 +07:00
3b12eb5e21 Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Has been cancelled
2025-12-23 23:45:06 +07:00
747458d7f3 Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Failing after 11s
2025-12-23 23:23:16 +07:00
fe8ab74bd3 Update .github/workflows/main.yml
Some checks failed
Build & Push Docker to Gitea Registry / build-and-push (push) Has been cancelled
2025-12-23 23:20:15 +07:00
354ea793c0 Update requirements.txt with new package versions 2025-12-15 08:34:09 +07:00
2 changed files with 29 additions and 114 deletions

View File

@@ -1,122 +1,37 @@
name: Build ChatGPT-Discord-Bot
name: Build & Push Docker to Gitea Registry
on:
push:
branches: [ main ]
workflow_dispatch:
env:
REGISTRY: git.quocanh.me
OWNER: coder-vippro
IMAGE: chatgpt-discord-bot
TAG: latest
jobs:
tests:
runs-on: ubuntu-latest
env:
MONGODB_URI: ${{ secrets.MONGODB_URI }}
environment: Private Server Deploy
build-and-push:
runs-on: ubuntu-latest # khuyên dùng runner của bạn
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version: '3.13.2'
cache: 'pip'
- name: Install dependencies
- name: Login to Gitea registry
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov flake8
pip install -r requirements.txt
echo "${{ secrets.REGISTRY_PASSWORD }}" \
| docker login "$REGISTRY" \
-u "${{ secrets.REGISTRY_USERNAME }}" \
--password-stdin
- name: Run unit tests with coverage
run: |
python -m pytest tests/ --cov=src
- name: Check dependencies for security issues
uses: pyupio/safety-action@v1.0.1
with:
api-key: ${{ secrets.SAFETY_API_KEY }}
build-amd64:
runs-on: ubuntu-latest
environment: Private Server Deploy
needs: tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for amd64
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64
tags: ghcr.io/coder-vippro/chatgpt-discord-bot:latest-amd64
build-arm64:
runs-on: ubuntu-24.04-arm
environment: Private Server Deploy
needs: tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image for arm64
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/arm64
tags: ghcr.io/coder-vippro/chatgpt-discord-bot:latest-arm64
merge-manifest:
runs-on: ubuntu-latest
needs: [build-amd64, build-arm64]
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push multi-arch manifest
- name: Build & push
run: |
docker buildx imagetools create -t ghcr.io/coder-vippro/chatgpt-discord-bot:latest \
ghcr.io/coder-vippro/chatgpt-discord-bot:latest-amd64 \
ghcr.io/coder-vippro/chatgpt-discord-bot:latest-arm64
deploy-notification:
runs-on: ubuntu-latest
needs: merge-manifest
if: ${{ success() }}
steps:
- name: Send deployment notification
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "✅ New deployment successful!"
description: |
Image: ${{ needs.build-and-push.outputs.image }}:${{ needs.build-and-push.outputs.version }}
Commit: ${{ github.sha }}
Repository: ${{ github.repository }}
color: 0x00ff00
username: GitHub Actions
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t $REGISTRY/$OWNER/$IMAGE:$TAG \
--push \
.

View File

@@ -10,12 +10,12 @@ dnspython>=2.5.0
# Web & HTTP
aiohttp>=3.9.0
requests>=2.31.0
requests>=2.32.5
beautifulsoup4>=4.12.0
# AI & ML
runware>=0.4.33
tiktoken>=0.7.0
tiktoken>=0.12.0
# Data Processing
pandas>=2.1.0