Skip to content

Commit

Permalink
Github Action : mise en place du yml de publication d'une image docker
Browse files Browse the repository at this point in the history
  • Loading branch information
jvk88511334 committed Mar 19, 2024
1 parent e122d68 commit af3ecb4
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Docker image

on:
push:
branches:
- main
- docker-compose-support

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: jeromev34/corbeaudocker:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM amazoncorretto:17
# FROM = a partir d'une image officielle va construire une image dérivée
# ATTENTION en cas de modification du code penser a systématiquement rebuilder l'application
# Copier le fichier JAR construit dans l'image
# Copier le fichier JAR (qui à été préalablement construit dans un repertoire target crée par la commande mvn package) dans l'image
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
# Exposer le port sur lequel l'application va tourner
Expand Down

0 comments on commit af3ecb4

Please sign in to comment.