release-pdf-converter.yml 3.7 KB

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