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