publish-smoke-test-spring-boot-images.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Publish Spring Boot images for smoke tests
  2. on:
  3. push:
  4. paths:
  5. - 'smoke-tests/images/spring-boot/**'
  6. - '.github/workflows/publish-smoke-test-spring-boot-images.yml'
  7. branches:
  8. - main
  9. workflow_dispatch:
  10. jobs:
  11. publish:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v2.3.4
  15. with:
  16. fetch-depth: 0
  17. - name: Set up JDK 11 for running Gradle
  18. uses: actions/setup-java@v2
  19. with:
  20. distribution: adopt
  21. java-version: 11
  22. - name: Cache gradle dependencies
  23. uses: burrunan/gradle-cache-action@v1.10
  24. with:
  25. job-id: spring-boot-smoke
  26. read-only: true
  27. - name: Cache Gradle Wrapper
  28. uses: actions/cache@v2
  29. with:
  30. path: ~/.gradle/wrapper
  31. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('smoke-tests/images/spring-boot/gradle/wrapper/gradle-wrapper.properties') }}
  32. - name: Login to GitHub Package Registry
  33. uses: docker/login-action@v1.10.0
  34. with:
  35. registry: ghcr.io
  36. username: ${{ github.repository_owner }}
  37. password: ${{ secrets.GITHUB_TOKEN }}
  38. - name: Build Docker Image
  39. run: |
  40. TAG="$(date '+%Y%m%d').$GITHUB_RUN_ID"
  41. echo "Pushing to tag $TAG"
  42. ./gradlew jib -PtargetJDK=8 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=$TAG
  43. ./gradlew jib -PtargetJDK=11 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=$TAG
  44. ./gradlew jib -PtargetJDK=17 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=$TAG
  45. ./gradlew jib -PtargetJDK=18 -Djib.httpTimeout=120000 -Djib.console=plain -Ptag=$TAG
  46. working-directory: smoke-tests/images/spring-boot
  47. issue:
  48. name: Open issue on failure
  49. needs: publish
  50. runs-on: ubuntu-latest
  51. if: always()
  52. steps:
  53. # run this action to get workflow conclusion
  54. # You can get conclusion by env (env.WORKFLOW_CONCLUSION)
  55. - uses: technote-space/workflow-conclusion-action@v2.2
  56. - uses: actions/checkout@v2.3.4
  57. with:
  58. fetch-depth: 0
  59. - uses: JasonEtco/create-an-issue@v2.6
  60. if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure
  61. env:
  62. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  63. with:
  64. filename: .github/templates/workflow-failed.md