Ajout du fichier README.md avec des instructions d'utilisation, des e… #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GitHub Action CI/CD Pipeline | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build_and_push: | |
| name: Push docker image to Docker Hub | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| run: echo "🔄 Récupération du code source..." | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| run: echo "🔧 Configuration de Docker Buildx..." | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| run: echo "🔐 Connexion à Docker Hub..." | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | |
| - name: Extract metadata for Docker | |
| run: echo "🏷️ Extraction des métadonnées Docker..." | |
| - name: Extract metadata (labels, tags, etc.) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: kalagaserge/mail_service | |
| - name: Build and push Docker image | |
| run: echo "🔨 Construction et publication de l'image Docker multi-plateforme..." | |
| - uses: docker/build-push-action@v5 | |
| with: | |
| context: ./ | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: kalagaserge/mail_service | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |