From 6fa943aacfc18ccaf208d2b40b983663c1a2dcf7 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 25 Mar 2024 18:58:37 +0100 Subject: [PATCH] ci: Automatically push new Docker image on a new release --- .../push-docker-image-to-docker-hub.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/push-docker-image-to-docker-hub.yml diff --git a/.github/workflows/push-docker-image-to-docker-hub.yml b/.github/workflows/push-docker-image-to-docker-hub.yml new file mode 100644 index 0000000..244c586 --- /dev/null +++ b/.github/workflows/push-docker-image-to-docker-hub.yml @@ -0,0 +1,30 @@ +name: Push Docker Image to Docker Hub + +on: + release: + types: [published] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: | + lelefan/observatoireproduits:latest + lelefan/observatoireproduits:${{ github.event.release.tag_name }}