From 3a00891e77d6380b7409ffccbf2c54144386396c Mon Sep 17 00:00:00 2001 From: Phanindra Allamsetty Date: Wed, 1 Jan 2025 23:55:39 -0500 Subject: [PATCH] Added changes to ci-cd.yml --- .github/workflows/ci-cd.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 8b13789..1329455 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -1 +1,33 @@ +name: CI/CD Pipeline +on: + push: + branches: + - * + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Setup JDK 21 + uses: actions/setup-java@v2 + with: + java-version: '21' + + - name: Build with Maven + run: ./mvnw clean package -DskipTests + + - name: Login into Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push Docker image + run: | + docker build -t ${{ secrets.DOCKER_HUB_USERNAME }}/bucket4j-rate-limiter:latest . + docker push ${{ secrets.DOCKER_HUB_USERNAME }}/bucket4j-rate-limiter:latest \ No newline at end of file