From 90e6cbf8bccfda8fa88a1061bd640ebbeb7066e4 Mon Sep 17 00:00:00 2001 From: Eduard Tolosa Date: Sat, 16 Apr 2022 20:14:34 -0500 Subject: [PATCH] Create cicd-to-dockerhub.yml --- .github/workflows/cicd-to-dockerhub.yml | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/cicd-to-dockerhub.yml diff --git a/.github/workflows/cicd-to-dockerhub.yml b/.github/workflows/cicd-to-dockerhub.yml new file mode 100644 index 0000000..414a69d --- /dev/null +++ b/.github/workflows/cicd-to-dockerhub.yml @@ -0,0 +1,34 @@ +name: ci-to-dockerhub + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + + - name: Build and push + id: docker_build + uses: docker/build-push-action@v2 + with: + context: ./ + file: ./Dockerfile + push: true + tags: ${{ secrets.DOCKER_HUB_USERNAME }}/unimap:latest + + - name: Image digest + run: echo ${{ steps.docker_build.outputs.digest }}