action
This commit is contained in:
parent
35af6f60a0
commit
69f8d4b1d2
2 changed files with 41 additions and 0 deletions
BIN
.github/workflows/.docker-publish.yml.swp
vendored
Normal file
BIN
.github/workflows/.docker-publish.yml.swp
vendored
Normal file
Binary file not shown.
41
.github/workflows/docker-publish.yml
vendored
Normal file
41
.github/workflows/docker-publish.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch: # Permet de lancer le build manuellement depuis GitHub
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: debian-latest
|
||||
|
||||
steps:
|
||||
# 1. Récupération du code source
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# 2. Configuration de Docker Buildx (indispensable pour la gestion avancée du cache)
|
||||
- name: Set up Docker Buildx
|
||||
uses: actions/setup-buildx-action@v3
|
||||
|
||||
# 3. Connexion à Docker Hub en utilisant les secrets configurés
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
# 4. Construction et envoi de l'image
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: |
|
||||
pazof/yavsc-build-env:latest
|
||||
pazof/yavsc-build-env:${{ github.sha }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue