Skip to content

Push to Master

Push to Master #27

name: Push to Master
on:
workflow_run:
workflows: ["Staging to Production"]
types:
- completed
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Étape 1 : Vérifier le code
- name: Checkout Code
uses: actions/checkout@v4
# Connexion à DockerHub
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# Construire et pousser l'image du backend
- name: Build and Push Backend Image
uses: docker/build-push-action@v5
with:
context: ./app/backend
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/ml_ops_rest_server:latest
# Construire et pousser l'image du frontend
- name: Build and Push Frontend Image
uses: docker/build-push-action@v5
with:
context: ./app/frontend
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/ml_ops_front_react:latest
# Construire et pousser l'image du serveur web
- name: Build and Push Web Server Image
uses: docker/build-push-action@v5
with:
context: ./app/nginx
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/ml_ops_web_server:latest