buildAndRelease.yml 580 B

123456789101112131415161718192021222324252627
  1. name: Release
  2. on:
  3. push:
  4. branches: [ main ]
  5. jobs:
  6. build:
  7. runs-on: ubuntu-latest
  8. steps:
  9. - uses: actions/checkout@v3
  10. - name: Build jar
  11. run: chmod +x ./mvnw && ./mvnw clean jar:jar
  12. - name: Run tests
  13. run: ./mvnw test
  14. - name: Build the Docker image
  15. run: ./mvnw spring-boot:build-image
  16. - name: Login to Docker Hub
  17. uses: docker/login-action@v2
  18. with:
  19. username: ${{ secrets.DOCKERHUB_USERNAME }}
  20. password: ${{ secrets.DOCKERHUB_TOKEN }}
  21. - name: Push image
  22. run: docker push lhamacorp/stocks-be