release-pdf-converter.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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_GROWIMOOGLE }} | docker login --username growimoogle --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@v6
  34. with:
  35. context: .
  36. file: ./apps/pdf-converter/docker/Dockerfile
  37. platforms: linux/amd64,linux/arm64
  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: Add tag
  44. uses: anothrNick/github-tag-action@v1
  45. env:
  46. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  47. CUSTOM_TAG: pdf-converter/v${{ steps.package-json.outputs.packageVersion }}
  48. VERBOSE : true
  49. - name: Update Docker Hub Description
  50. uses: peter-evans/dockerhub-description@v3
  51. with:
  52. username: growimoogle
  53. password: ${{ secrets.DOCKER_REGISTRY_PASSWORD_GROWIMOOGLE }}
  54. repository: growilabs/pdf-converter
  55. readme-filepath: ./apps/pdf-converter/docker/README.md
  56. create-pr-for-next-rc:
  57. needs: build-and-push-image
  58. runs-on: ubuntu-latest
  59. strategy:
  60. matrix:
  61. node-version: [20.x]
  62. steps:
  63. - uses: actions/checkout@v4
  64. with:
  65. ref: ${{ github.event.pull_request.base.ref }}
  66. - uses: pnpm/action-setup@v4
  67. - uses: actions/setup-node@v4
  68. with:
  69. node-version: ${{ matrix.node-version }}
  70. cache: 'pnpm'
  71. - name: Install dependencies
  72. run: |
  73. pnpm add turbo --global
  74. pnpm install --frozen-lockfile
  75. - name: Bump versions for next RC
  76. run: |
  77. turbo run version:prerelease --filter=@growi/pdf-converter
  78. - name: Retrieve information from package.json
  79. uses: myrotvorets/info-from-package-json-action@2.0.1
  80. id: package-json
  81. with:
  82. workingDir: apps/pdf-converter
  83. - name: Commit
  84. uses: github-actions-x/commit@v2.9
  85. with:
  86. github-token: ${{ secrets.GITHUB_TOKEN }}
  87. push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  88. commit-message: 'Bump version'
  89. name: GitHub Action
  90. - name: Create PR
  91. uses: repo-sync/pull-request@v2
  92. with:
  93. source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  94. destination_branch: master
  95. pr_title: Prepare pdf-converter v${{ steps.package-json.outputs.packageVersion }}
  96. pr_label: flag/exclude-from-changelog,type/prepare-next-version
  97. pr_body: "An automated PR generated by ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
  98. github_token: ${{ secrets.GITHUB_TOKEN }}