diff --git a/.env.example b/.env.example deleted file mode 100644 index 7f886eb..0000000 --- a/.env.example +++ /dev/null @@ -1,5 +0,0 @@ -# Configuration Zabbix (optionnel) -ENABLE_ZABBIX=false -ZABBIX_SERVER=zabbix-server.example.com -ZABBIX_HOSTNAME=MamieHenriette -ZABBIX_PORT=10050 \ No newline at end of file diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 4a205e6..361699b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,81 +1,41 @@ -name: Build and Push Docker Image +name: Create and publish a Docker image on: push: - branches: [ main ] - tags: [ 'v*' ] - pull_request: - branches: [ main ] + branches: ['main'] env: REGISTRY: ghcr.io - IMAGE_NAME: skylanix/mamiehenriette + IMAGE_NAME: ${{ github.repository }} jobs: - build: + build-and-push-image: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Extract metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=raw,value=latest,enable={{is_default_branch}} - labels: | - org.opencontainers.image.title=${{ github.repository }} - org.opencontainers.image.description=Bot multi-plateformes Discord/Twitch/YouTube pour la communauté STEvE - org.opencontainers.image.source=https://github.com/${{ github.repository }} - org.opencontainers.image.url=https://github.com/${{ github.repository }} - org.opencontainers.image.licenses=GPL-3.0 - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Test container startup - run: | - echo "Testing if the container starts successfully..." - docker run --rm -d --name test-container -p 5000:5000 \ - -e TZ=Europe/Paris \ - -e ENABLE_ZABBIX=false \ - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - - # Wait for container to be ready - sleep 60 - - # Check if container is still running - if docker ps | grep test-container; then - echo "✅ Container started successfully" - docker logs test-container - else - echo "❌ Container failed to start" - docker logs test-container - exit 1 - fi - - # Stop the test container - docker stop test-container \ No newline at end of file + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 029232b..e40c22d 100755 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && rm zabbix-release_latest_7.4+debian12_all.deb COPY requirements.txt . -#COPY run-web.py . +COPY run-web.py . COPY ./database ./database COPY ./discordbot ./discordbot COPY ./protondb ./protondb diff --git a/run-web.py b/run-web.py index bcb00fc..b865860 100644 --- a/run-web.py +++ b/run-web.py @@ -23,7 +23,7 @@ def start_twitch_bot(): twitchBot.begin() if __name__ == '__main__': - locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8') + locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8') jobs = [] jobs.append(threading.Thread(target=start_discord_bot))