release-pdf-converter.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. name: Release Docker Image for @growi/pdf-converter
  2. on:
  3. pull_request:
  4. branches:
  5. - release/pdf-converter/**
  6. types: [closed]
  7. jobs:
  8. build-and-push-image:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v4
  12. with:
  13. ref: ${{ github.event.pull_request.base.ref }}
  14. - name: Retrieve information from package.json
  15. uses: myrotvorets/info-from-package-json-action@2.0.1
  16. id: package-json
  17. with:
  18. workingDir: apps/pdf-converter
  19. - name: Docker meta
  20. id: meta
  21. uses: docker/metadata-action@v4
  22. with:
  23. images: growilabs/pdf-converter
  24. tags: |
  25. type=raw,value=latest
  26. type=raw,value=${{ steps.package-json.outputs.packageVersion }}
  27. - name: Login to docker.io registry
  28. run: |
  29. echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
  30. - name: Set up Docker Buildx
  31. uses: docker/setup-buildx-action@v3
  32. - name: Build and push
  33. uses: docker/build-push-action@v4
  34. with:
  35. context: .
  36. file: ./apps/pdf-converter/docker/Dockerfile
  37. platforms: linux/amd64
  38. push: true
  39. builder: ${{ steps.buildx.outputs.name }}
  40. cache-from: type=gha
  41. cache-to: type=gha,mode=max
  42. tags: ${{ steps.meta.outputs.tags }}
  43. - name: Move cache
  44. run: |
  45. rm -rf /tmp/.buildx-cache
  46. mv /tmp/.buildx-cache-new /tmp/.buildx-cache
  47. - name: Add tag
  48. uses: anothrNick/github-tag-action@v1
  49. env:
  50. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  51. CUSTOM_TAG: v${{ steps.package-json.outputs.packageVersion }}
  52. VERBOSE : true
  53. - name: Update Docker Hub Description
  54. uses: peter-evans/dockerhub-description@v3
  55. with:
  56. username: wsmoogle
  57. password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
  58. repository: growilabs/pdf-converter
  59. readme-filepath: ./apps/pdf-converter/docker/README.md
  60. create-pr-for-next-rc:
  61. needs: build-and-push-image
  62. runs-on: ubuntu-latest
  63. strategy:
  64. matrix:
  65. node-version: [20.x]
  66. steps:
  67. - uses: actions/checkout@v4
  68. with:
  69. ref: ${{ github.event.pull_request.base.ref }}
  70. - uses: pnpm/action-setup@v4
  71. - uses: actions/setup-node@v4
  72. with:
  73. node-version: ${{ matrix.node-version }}
  74. cache: 'pnpm'
  75. - name: Install dependencies
  76. run: |
  77. pnpm add turbo --global
  78. pnpm install --frozen-lockfile
  79. - name: Bump versions for next RC
  80. run: |
  81. turbo run version:prerelease --filter=@growi/pdf-converter
  82. - name: Retrieve information from package.json
  83. uses: myrotvorets/info-from-package-json-action@2.0.1
  84. id: package-json
  85. with:
  86. workingDir: apps/pdf-converter
  87. - name: Commit
  88. uses: github-actions-x/commit@v2.9
  89. with:
  90. github-token: ${{ secrets.GITHUB_TOKEN }}
  91. push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  92. commit-message: 'Bump version'
  93. name: GitHub Action
  94. - name: Create PR
  95. uses: repo-sync/pull-request@v2
  96. with:
  97. source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  98. destination_branch: master
  99. pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
  100. pr_label: flag/exclude-from-changelog,type/prepare-next-version
  101. pr_body: "An automated PR generated by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
  102. github_token: ${{ secrets.GITHUB_TOKEN }}