From edb01849fcbf983c24f300563f1947b786ab73e7 Mon Sep 17 00:00:00 2001 From: Leon Date: Thu, 12 Mar 2026 15:09:24 +0100 Subject: [PATCH] try fix --- .gitea/workflows/deploy.yml | 38 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 55802a7..ccf69cd 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -11,20 +11,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - - name: Run Tests uses: docker://laravelsail/php84-composer:latest - env: - APP_ENV: testing - APP_KEY: base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= - DB_CONNECTION: sqlite - DB_DATABASE: ":memory:" with: - args: | - bash -c "apt-get update && apt-get install -y libicu-dev && \ - docker-php-ext-configure intl && docker-php-ext-install intl && \ - composer install --no-interaction && \ - php artisan test" + args: bash -c "composer install --no-interaction && php artisan test" build: name: "Build & Push Docker" @@ -36,31 +26,25 @@ jobs: uses: actions/checkout@v4 - name: Login to Gitea Registry - env: - REGISTRY_URL: ${{ github.server_url }} - REGISTRY_USER: ${{ github.actor }} - REGISTRY_TOKEN: ${{ secrets.TOKEN_GITEA }} - run: | - REGISTRY="${REGISTRY_URL#https://}" - REGISTRY="${REGISTRY#http://}" - echo "$REGISTRY_TOKEN" | docker login "$REGISTRY" -u "$REGISTRY_USER" --password-stdin + uses: docker/login-action@v3 # L'action officielle est plus simple ! + with: + registry: ${{ github.server_url }} + username: ${{ github.actor }} + password: ${{ secrets.TOKEN_GITEA }} - name: Build and Push run: | - # On utilise l'image du serveur Gitea - REGISTRY="${{ github.server_url }}" - REGISTRY="${REGISTRY#https://}" - REGISTRY="${REGISTRY#http://}" - IMAGE="$REGISTRY/${{ github.repository }}:latest" + # On nettoie l'URL pour Docker (enlève https://) + REGISTRY_DOMAIN=$(echo "${{ github.server_url }}" | sed -e 's|https://||' -e 's|http://||') + IMAGE="$REGISTRY_DOMAIN/${{ github.repository }}:latest" + docker build -t "$IMAGE" . docker push "$IMAGE" deploy: name: "Déploiement Simplifié" needs: build - if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - name: Trigger Portainer Webhook - run: | - curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}" + run: curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"