-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (41 loc) · 1.46 KB
/
Copy pathci_cd.yml
File metadata and controls
47 lines (41 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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:v1.0.1
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max