mirror of
https://github.com/skylanix/MamieHenriette.git
synced 2026-02-16 13:00:39 +01:00
Retire CI test et fichier .env Docker et corrige docker-build.yml
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
# Configuration Zabbix (optionnel)
|
|
||||||
ENABLE_ZABBIX=false
|
|
||||||
ZABBIX_SERVER=zabbix-server.example.com
|
|
||||||
ZABBIX_HOSTNAME=MamieHenriette
|
|
||||||
ZABBIX_PORT=10050
|
|
||||||
88
.github/workflows/docker-build.yml
vendored
88
.github/workflows/docker-build.yml
vendored
@@ -1,81 +1,41 @@
|
|||||||
name: Build and Push Docker Image
|
name: Create and publish a Docker image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: ['main']
|
||||||
tags: [ 'v*' ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: skylanix/mamiehenriette
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-and-push-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Log in to the Container registry
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
uses: docker/login-action@v3
|
id: meta
|
||||||
with:
|
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||||
registry: ${{ env.REGISTRY }}
|
with:
|
||||||
username: ${{ github.actor }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata
|
- name: Build and push Docker image
|
||||||
id: meta
|
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
|
||||||
uses: docker/metadata-action@v5
|
with:
|
||||||
with:
|
context: .
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
push: true
|
||||||
tags: |
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
type=ref,event=branch
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
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
|
|
||||||
@@ -23,7 +23,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& rm zabbix-release_latest_7.4+debian12_all.deb
|
&& rm zabbix-release_latest_7.4+debian12_all.deb
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
#COPY run-web.py .
|
COPY run-web.py .
|
||||||
COPY ./database ./database
|
COPY ./database ./database
|
||||||
COPY ./discordbot ./discordbot
|
COPY ./discordbot ./discordbot
|
||||||
COPY ./protondb ./protondb
|
COPY ./protondb ./protondb
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ def start_twitch_bot():
|
|||||||
twitchBot.begin()
|
twitchBot.begin()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
locale.setlocale(locale.LC_TIME, 'fr_CH.UTF-8')
|
locale.setlocale(locale.LC_TIME, 'fr_FR.UTF-8')
|
||||||
|
|
||||||
jobs = []
|
jobs = []
|
||||||
jobs.append(threading.Thread(target=start_discord_bot))
|
jobs.append(threading.Thread(target=start_discord_bot))
|
||||||
|
|||||||
Reference in New Issue
Block a user