try fix ci cd
This commit is contained in:
parent
acf9f5c772
commit
069f70aa76
|
|
@ -2,39 +2,40 @@ name: Laravel CI-CD (Gitea)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: ["main"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
|
||||||
name: "Tests Unitaires"
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
test:
|
||||||
steps:
|
name: "Tests Unitaires"
|
||||||
- name: Checkout code
|
runs-on: ubuntu-latest
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
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 "composer install --no-interaction --ignore-platform-req=ext-intl && php artisan test"
|
||||||
|
|
||||||
- name: Run Tests
|
|
||||||
uses: docker://laravelsail/php84-composer:latest
|
|
||||||
env:
|
|
||||||
APP_ENV: testing
|
|
||||||
APP_KEY: base64:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
|
|
||||||
DB_CONNECTION: sqlite
|
|
||||||
DB_DATABASE: ":memory:"
|
|
||||||
with:
|
|
||||||
# AJOUT de --ignore-platform-req=ext-intl
|
|
||||||
args: |
|
|
||||||
bash -c "composer install --no-interaction --ignore-platform-req=ext-intl && php artisan test"
|
|
||||||
build:
|
build:
|
||||||
name: "Build & Push Docker"
|
name: "Build & Push Docker"
|
||||||
needs: test
|
needs: test
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Login to Gitea Registry
|
- name: Login to Gitea Registry
|
||||||
uses: docker/login-action@v3 # L'action officielle est plus simple !
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ github.server_url }}
|
registry: ${{ github.server_url }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
|
|
@ -42,7 +43,6 @@ test:
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
run: |
|
run: |
|
||||||
# On nettoie l'URL pour Docker (enlève https://)
|
|
||||||
REGISTRY_DOMAIN=$(echo "${{ github.server_url }}" | sed -e 's|https://||' -e 's|http://||')
|
REGISTRY_DOMAIN=$(echo "${{ github.server_url }}" | sed -e 's|https://||' -e 's|http://||')
|
||||||
IMAGE="$REGISTRY_DOMAIN/${{ github.repository }}:latest"
|
IMAGE="$REGISTRY_DOMAIN/${{ github.repository }}:latest"
|
||||||
|
|
||||||
|
|
@ -53,6 +53,7 @@ test:
|
||||||
name: "Déploiement Simplifié"
|
name: "Déploiement Simplifié"
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Trigger Portainer Webhook
|
- name: Trigger Portainer Webhook
|
||||||
run: curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
run: curl -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue