From 1485302bf15a68c50e6e637c23d4b927c6b9134b Mon Sep 17 00:00:00 2001 From: Ruslan Gladov Date: Wed, 12 Jun 2024 14:54:02 +0300 Subject: [PATCH] Adding ci_build.yaml --- .github/workflows/ci_build.yaml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci_build.yaml diff --git a/.github/workflows/ci_build.yaml b/.github/workflows/ci_build.yaml new file mode 100644 index 000000000000..7a2d0ba25219 --- /dev/null +++ b/.github/workflows/ci_build.yaml @@ -0,0 +1,36 @@ +name: Merge Events + +on: + pull_request: + types: + - closed + push: + branches: + - main +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 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 and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: your-dockerhub-username/your-repo-name:${{ github.sha }} + + - name: Log out from Docker Hub + run: docker logout \ No newline at end of file