image.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # This workflow will build a Java project with Maven
  2. # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
  3. name: PIG 镜像 action
  4. on:
  5. push:
  6. branches: [ jdk17 ]
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. strategy:
  11. matrix:
  12. java-version: [ 17 ]
  13. steps:
  14. - uses: actions/checkout@v4
  15. - name: Set up JDK ${{ matrix.java-version }}
  16. uses: actions/setup-java@v4
  17. with:
  18. java-version: ${{ matrix.java-version }}
  19. distribution: 'zulu'
  20. - name: mvn clean install
  21. run: mvn clean install -Pcloud
  22. - name: Login to Docker Registry
  23. run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} registry.cn-hangzhou.aliyuncs.com
  24. - name: Build and push Docker images
  25. run: |
  26. docker-compose build
  27. registry="registry.cn-hangzhou.aliyuncs.com/lttcaix/"
  28. for service in $(docker-compose config --services); do
  29. if [ "$service" != "lttcai-redis" ]; then
  30. docker tag ${service}:latest ${registry}${service}:latest
  31. docker push ${registry}${service}:latest
  32. else
  33. echo "Skipping lttcai-redis service"
  34. fi
  35. done