feat: ajouter des statistiques de tableau de bord pour les commandes,… #7
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 images to Docker Hub | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - service: backend | |
| context: ./backend | |
| dockerfile: ./backend/Dockerfile | |
| image: kalagaserge/commandkeeper-backend | |
| - service: frontend | |
| context: ./frontend | |
| dockerfile: ./frontend/Dockerfile | |
| image: kalagaserge/commandkeeper-frontend | |
| steps: | |
| - name: Checkout the repository | |
| run: echo "🔄 Checking out source code..." | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| run: echo "🔧 Setting up Docker Buildx..." | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Login to Docker Hub | |
| run: echo "🔐 Logging in to Docker Hub..." | |
| - uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} | |
| - name: Extract metadata for Docker | |
| run: echo "🏷️ Extracting Docker metadata (${{ matrix.service }})..." | |
| - name: Extract metadata (labels, tags, etc.) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ matrix.image }} | |
| tags: | | |
| type=raw,value=latest | |
| type=sha | |
| - name: Build and push Docker image (${{ matrix.service }}) | |
| id: build | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ${{ matrix.context }} | |
| file: ${{ matrix.dockerfile }} | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Job summary (${{ matrix.service }}) | |
| if: always() | |
| run: | | |
| { | |
| echo "## 🐳 Docker push summary — ${{ matrix.service }}" | |
| echo | |
| echo "- **Image**: \`${{ matrix.image }}\`" | |
| echo "- **Context**: \`${{ matrix.context }}\`" | |
| echo "- **Dockerfile**: \`${{ matrix.dockerfile }}\`" | |
| echo "- **Digest**: \`${{ steps.build.outputs.digest }}\`" | |
| echo | |
| echo "### 🏷️ Tags pushed" | |
| echo | |
| echo "\`\`\`" | |
| echo "${{ steps.meta.outputs.tags }}" | |
| echo "\`\`\`" | |
| } >> "$GITHUB_STEP_SUMMARY" |