From f4e257b9af71268e08c95e6989fe6d43f22530c7 Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:00:56 +0100 Subject: [PATCH 1/5] fix: armv6 build --- .github/workflows/docker-image.yml | 1 + Dockerfile | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d8678b3..dd97252 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,6 +4,7 @@ on: push: branches: - 'main' + - 'docker' jobs: docker: diff --git a/Dockerfile b/Dockerfile index 1110005..099263c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ # Dockerfile for the python discord bot -FROM python:3.12-alpine +FROM python:3.11-alpine WORKDIR /usr/src/chouettebot COPY . . -RUN pip --no-cache-dir install -r requirements.txt +RUN echo -e "[global]\nextra-index-url=https://www.piwheels.org/simple" >> /usr/local/pip.conf && \ + pip --no-cache-dir install -r requirements.txt EXPOSE 8080 CMD ["python3", "main.py"] From 805d5004bdd074fc6d716e872f75bef2bce9267d Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 29 Mar 2024 11:19:04 +0100 Subject: [PATCH 2/5] fix: use getenv --- utils/skyblock_guild.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/skyblock_guild.py b/utils/skyblock_guild.py index a47b299..4502fe4 100644 --- a/utils/skyblock_guild.py +++ b/utils/skyblock_guild.py @@ -1,8 +1,8 @@ import aiohttp -from dotenv import dotenv_values +from os import getenv api_hypixel = "https://api.hypixel.net/" -token_hypixel = dotenv_values()["HYPIXEL_KEY"] +token_hypixel = getenv("HYPIXEL_KEY") async def fetch(session, url, params=None): From cbe4e892e9a028a722473cf7a3a816f416cc0f40 Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 29 Mar 2024 14:12:04 +0100 Subject: [PATCH 3/5] feat: build docker image on more arm platforms --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index dd97252..8d69eff 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,4 +28,4 @@ jobs: with: push: true tags: gylfirst/chouettebot:latest,gylfirst/chouettebot:v0.0.${{ github.run_number }} - platforms: linux/amd64, linux/arm/v6 + platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64/v8 From b7eee63594d464a0e01fdf3b38f3b024be93b700 Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 29 Mar 2024 14:15:20 +0100 Subject: [PATCH 4/5] fix: build not passing on arm64 --- .github/workflows/docker-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 8d69eff..d7518be 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -28,4 +28,4 @@ jobs: with: push: true tags: gylfirst/chouettebot:latest,gylfirst/chouettebot:v0.0.${{ github.run_number }} - platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64/v8 + platforms: linux/amd64, linux/arm/v6, linux/arm/v7 From 72f4f224db9b566a636cfa3ef82a06b5b5bb128d Mon Sep 17 00:00:00 2001 From: Zalk0 <88582103+zalk0@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:20:56 +0100 Subject: [PATCH 5/5] fix: build only on main --- .github/workflows/docker-image.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d7518be..e6531c2 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,27 +3,25 @@ name: ci on: push: branches: - - 'main' - - 'docker' + - main jobs: docker: runs-on: ubuntu-latest steps: - - - name: Set up QEMU + - name: Set up QEMU uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx + + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub + + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push + + - name: Build and push uses: docker/build-push-action@v5 with: push: true