From 5c4504cf76585faa2a9d0534e48ddc6546495aa8 Mon Sep 17 00:00:00 2001 From: Rodin Velichkov Date: Tue, 6 Aug 2024 21:28:16 +0300 Subject: [PATCH] [Add Docker Image Build Workflow] Details: - Triggers when a PR with label CI:Build is merged - Builds a new docker image of the given project - Uploads it to dockerhub - Move pre-existing workflow to .bk --- .github/workflows/ci-build.yml | 29 +++++++++++++++++++++++++ .github/workflows/{go.yml => go.yml.bk} | 0 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/ci-build.yml rename .github/workflows/{go.yml => go.yml.bk} (100%) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000000..d31c21844ed1 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,29 @@ +name: CI Build + +on: + pull_request: + types: [closed] + +jobs: + build: + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build') + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/go-ethereum-limechain:${{ github.sha }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml.bk similarity index 100% rename from .github/workflows/go.yml rename to .github/workflows/go.yml.bk