From e5a851a3c49bb1e9f421be2898d7b34ad9a4d276 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 22:44:41 +0200 Subject: [PATCH 01/16] ci: migrate ci-cd pipeline from github to gitea registry --- .github/workflows/ci-cd.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 652b535..be847ca 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -5,11 +5,11 @@ on: branches: [main] env: - REGISTRY: ghcr.io + REGISTRY: gitea.nasvincent.com jobs: test: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 @@ -27,8 +27,7 @@ jobs: build-and-push: needs: test - environment: DEV - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: write packages: write @@ -47,8 +46,8 @@ jobs: - uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.TOKEN }} - uses: docker/build-push-action@v5 with: context: . @@ -57,17 +56,17 @@ jobs: tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max - name: Create Git tag run: | - git config user.email "action@github.com" - git config user.name "GitHub Action" + git config user.email "action@gitea.nasvincent.com" + git config user.name "Gitea Action" git tag ${{ steps.version.outputs.new_version }} git push origin ${{ steps.version.outputs.new_version }} - name: Save new minor version - env: - GH_TOKEN: ${{ secrets.PAT_ADMIN_TOKEN }} - GH_REPO: ${{ github.repository }} run: | - gh variable set VERSION_MINOR --body "${{ steps.version.outputs.new_minor }}" --env DEV + curl -s -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ + -H "Authorization: token ${{ secrets.TOKEN }}" \ + -H "Content-Type: application/json" \ + -d "{\"value\": \"${{ steps.version.outputs.new_minor }}\"}" -- 2.52.0 From 11201114f39006ce4b5f094cfb44f874dcdb8579 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 22:46:53 +0200 Subject: [PATCH 02/16] caca --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index be847ca..62d0f05 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -2,7 +2,7 @@ name: Publish Docker Image on: push: - branches: [main] + branches: [gitea] env: REGISTRY: gitea.nasvincent.com -- 2.52.0 From 202fb79ef1e6d3e37026aca3e1ae62091f5ed3aa Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 23:53:09 +0200 Subject: [PATCH 03/16] pipi --- .github/workflows/ci-cd.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 62d0f05..b2607ee 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,12 +12,9 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - name: Install dependencies run: | - python -m pip install --upgrade pip + python3 -m pip install --upgrade pip pip install -r src/requirements.txt - name: Lint and format with Ruff run: | -- 2.52.0 From b6ef949201eb814a2715161e34a04aa1c3b6481e Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 23:56:22 +0200 Subject: [PATCH 04/16] zizi --- .github/workflows/ci-cd.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index b2607ee..7dae1c1 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -14,11 +14,12 @@ jobs: - uses: actions/checkout@v4 - name: Install dependencies run: | + apt-get install -y python3-pip python3 -m pip install --upgrade pip - pip install -r src/requirements.txt + pip3 install -r src/requirements.txt - name: Lint and format with Ruff run: | - pip install ruff + pip3 install ruff ruff check src ruff format --check src -- 2.52.0 From f9c6f245b9b37fc0c722d396743f3d8827a2939d Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 23:58:08 +0200 Subject: [PATCH 05/16] mabite --- .github/workflows/ci-cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 7dae1c1..fbe20b3 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -14,7 +14,6 @@ jobs: - uses: actions/checkout@v4 - name: Install dependencies run: | - apt-get install -y python3-pip python3 -m pip install --upgrade pip pip3 install -r src/requirements.txt - name: Lint and format with Ruff -- 2.52.0 From de330a288ef3a9205243e00b9affea0597f8157b Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sat, 30 May 2026 23:59:06 +0200 Subject: [PATCH 06/16] zizi --- .github/workflows/ci-cd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index fbe20b3..124822c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,6 +12,9 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install dependencies run: | python3 -m pip install --upgrade pip -- 2.52.0 From c8479995696314c9fb39b068d7104356e35becca Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:00:33 +0200 Subject: [PATCH 07/16] caca --- .github/workflows/ci-cd.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 124822c..ac7b86f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -12,11 +12,9 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - name: Install dependencies run: | + apt-get update && apt-get install -y python3-pip python3 -m pip install --upgrade pip pip3 install -r src/requirements.txt - name: Lint and format with Ruff -- 2.52.0 From fd05a0cf0573fd5df2ec3d4fb58bced47bdb1e0f Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:01:57 +0200 Subject: [PATCH 08/16] bite --- .github/workflows/ci-cd.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index ac7b86f..26bccb7 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -15,8 +15,8 @@ jobs: - name: Install dependencies run: | apt-get update && apt-get install -y python3-pip - python3 -m pip install --upgrade pip - pip3 install -r src/requirements.txt + python3 -m pip install --upgrade pip --break-system-packages + pip3 install -r src/requirements.txt --break-system-packages - name: Lint and format with Ruff run: | pip3 install ruff -- 2.52.0 From e8a9c06357bb56578f2a55523847d7c3c92861fb Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:04:21 +0200 Subject: [PATCH 09/16] teub --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 26bccb7..19c4e7c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -19,7 +19,7 @@ jobs: pip3 install -r src/requirements.txt --break-system-packages - name: Lint and format with Ruff run: | - pip3 install ruff + pip3 install ruff --break-system-packages ruff check src ruff format --check src -- 2.52.0 From afce687bba9d4ed9475f20ffcee048b9f1976177 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:12:45 +0200 Subject: [PATCH 10/16] zeub --- .github/workflows/ci-cd.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 19c4e7c..0ddd62c 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -31,6 +31,9 @@ jobs: packages: write steps: - uses: actions/checkout@v4 + - name: Install Docker + run: | + apt-get update && apt-get install -y docker.io - name: Lowercase repository name run: echo "IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/discord-bot" >> $GITHUB_ENV - name: Calculate new version -- 2.52.0 From 0cbeac3b0e84f41ae254691cab65dbcecbd51a70 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:22:53 +0200 Subject: [PATCH 11/16] a --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9fa4310..86fd088 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,10 @@ A Discord bot with slash commands for meme generation and more. ## Setup +a + ### Local Development + ```bash git clone https://github.com/EstebanVincent/DiscordBot.git cd DiscordBot @@ -21,6 +24,7 @@ uv run python src/main.py ``` ### Docker + ```bash # Build and run locally docker build -t discord-bot . @@ -38,10 +42,9 @@ docker run -d --name discord-bot -e DISCORD_TOKEN=... -e WEBHOOK_URL=... -e API_ ## Discord Setup 1. Create bot at [Discord Developer Portal](https://discord.com/developers/applications) -2. Copy bot token to environment variables +2. Copy bot token to environment variables 3. Invite bot with permissions: Send Messages, Use Slash Commands, Embed Links - ## Development ```bash -- 2.52.0 From 575dbc18541fa2d6c3fd986ece44a5109be1676b Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:38:43 +0200 Subject: [PATCH 12/16] rt --- .github/workflows/ci-cd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 0ddd62c..df4ede6 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -57,6 +57,8 @@ jobs: tags: | ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.new_version }} ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:cache,mode=max - name: Create Git tag -- 2.52.0 From e573055766ab9d939c57ee9f65e6d3431d814be8 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:45:23 +0200 Subject: [PATCH 13/16] caca --- .github/workflows/ci-cd.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index df4ede6..dad1ad2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -65,11 +65,10 @@ jobs: run: | git config user.email "action@gitea.nasvincent.com" git config user.name "Gitea Action" - git tag ${{ steps.version.outputs.new_version }} - git push origin ${{ steps.version.outputs.new_version }} + git tag ${{ steps.version.outputs.new_version }} && git push origin ${{ steps.version.outputs.new_version }} || echo "Tag already exists, skipping" - name: Save new minor version run: | - curl -s -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ + curl -sf -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ -H "Authorization: token ${{ secrets.TOKEN }}" \ -H "Content-Type: application/json" \ -d "{\"value\": \"${{ steps.version.outputs.new_minor }}\"}" -- 2.52.0 From 70451b02ee07995113d148855ff00ef2c46a028f Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:51:38 +0200 Subject: [PATCH 14/16] s --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index dad1ad2..03a194a 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -68,7 +68,7 @@ jobs: git tag ${{ steps.version.outputs.new_version }} && git push origin ${{ steps.version.outputs.new_version }} || echo "Tag already exists, skipping" - name: Save new minor version run: | - curl -sf -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ + curl -f -X PUT "https://gitea.nasvincent.com/api/v1/repos/${{ github.repository }}/actions/variables/VERSION_MINOR" \ -H "Authorization: token ${{ secrets.TOKEN }}" \ -H "Content-Type: application/json" \ -d "{\"value\": \"${{ steps.version.outputs.new_minor }}\"}" -- 2.52.0 From 670bd977be2520619b609db4d4cde5f6cd53ad53 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 00:51:38 +0200 Subject: [PATCH 15/16] a --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 86fd088..caaf13a 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,10 @@ A Discord bot with slash commands for meme generation and more. - [uv](https://docs.astral.sh/uv/) - Fast Python package manager - Discord Bot Token - n8n Webhook URL and API Key + π ## Setup -a - ### Local Development ```bash -- 2.52.0 From cb3b9ed2d985d3b4b5d4d6577819b1f929144034 Mon Sep 17 00:00:00 2001 From: Esteban Vincent Date: Sun, 31 May 2026 01:11:56 +0200 Subject: [PATCH 16/16] main --- .github/workflows/ci-cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 03a194a..68532e2 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -2,7 +2,7 @@ name: Publish Docker Image on: push: - branches: [gitea] + branches: [main] env: REGISTRY: gitea.nasvincent.com -- 2.52.0