From 9b7223cea5cb56eef35d7be6ce50655f391bf322 Mon Sep 17 00:00:00 2001 From: dzivdzi Date: Thu, 5 Sep 2024 13:17:58 +0300 Subject: [PATCH] added workflow --- .github/workflows/ci-build.yml | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 0000000000..a4075c92a6 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,37 @@ +name: Build and Push Docker Image + +on: + pull_request: + types: [closed] + branches: + - main + labels: + - 'CI:Build' + +jobs: + build: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + steps: + - name: Checkout the code + uses: actions/checkout@v3 + + - 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.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build the Docker image + run: | + docker build -t dzivdzi/go-ethereum:${{ github.sha }} . + docker tag dzivdzi/go-ethereum:${{ github.sha }} dzivdzi/go-ethereum:latest + + - name: Push the Docker image + run: | + docker push dzivdzi/go-ethereum:${{ github.sha }} + docker push dzivdzi/go-ethereum:latest \ No newline at end of file