From 93cb163aa7db36b9aa6475850aa2e091f12971cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Birm=C3=A9?= Date: Thu, 9 May 2024 21:18:30 +0200 Subject: [PATCH] chore: publish image to Docker Hub when a tag is released --- .github/workflows/run-publish.yml | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/run-publish.yml diff --git a/.github/workflows/run-publish.yml b/.github/workflows/run-publish.yml new file mode 100644 index 0000000..32edcbb --- /dev/null +++ b/.github/workflows/run-publish.yml @@ -0,0 +1,40 @@ +name: Build image and push to Docker Hub + +on: + release: + types: [released] + +jobs: + push_to_registry: + name: Push Docker Image to Docker Hub + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.HUB_DOCKER_USERNAME }} + password: ${{ secrets.HUB_DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: eyevinntechnology/intercom-frontend + + - name: Build and push Docker image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}