another try #58
This file contains 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: Build and Push Docker Image to GitLab Registry | |
# Déclencher ce workflow lors d'un push ou d'une pull request sur les branches 'main' ou 'dev' | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout du code source | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Connexion au GitLab Container Registry | |
- name: Log in to GitLab Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: gitlab.com | |
username: ${{ secrets.GITLAB_USERNAME }} | |
password: ${{ secrets.GITLAB_TOKEN }} | |
# Construire l'image Docker | |
- name: Build Docker image | |
run: docker build -t registry.gitlab.com/${{ secrets.GITLAB_PROJECT_PATH }}/epsilonbot:${{ github.sha }} . | |
# Pousser l'image vers le GitLab Container Registry | |
- name: Push Docker image | |
run: docker push registry.gitlab.com/${{ secrets.GITLAB_PROJECT_PATH }}/epsilonbot:${{ github.sha }} |