release-pdf-converter.yml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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. # TODO: setup GCP_PRJ_ID_PDF_CONVERTER
  24. images: weseek/growi-pdf-converter,asia.gcr.io/${{ secrets.GCP_PRJ_ID_PDF_CONVERTER }}/growi-pdf-converter
  25. tags: |
  26. type=raw,value=latest
  27. type=raw,value=${{ steps.package-json.outputs.packageVersion }}
  28. - name: Login to docker.io registry
  29. run: |
  30. echo ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | docker login --username wsmoogle --password-stdin
  31. - name: Authenticate to Google Cloud for GROWI.cloud
  32. uses: google-github-actions/auth@v1
  33. with:
  34. # TODO: setup GCP_SA_KEY_PDF_CONVERTER
  35. credentials_json: '${{ secrets.GCP_SA_KEY_PDF_CONVERTER }}'
  36. - name: Setup gcloud
  37. uses: google-github-actions/setup-gcloud@v2
  38. - name: Configure docker for gcloud
  39. run: |
  40. gcloud auth configure-docker --quiet
  41. - name: Set up Docker Buildx
  42. uses: docker/setup-buildx-action@v3
  43. - name: Build and push
  44. uses: docker/build-push-action@v4
  45. with:
  46. context: .
  47. file: ./apps/pdf-converter/docker/Dockerfile
  48. platforms: linux/amd64
  49. push: true
  50. builder: ${{ steps.buildx.outputs.name }}
  51. cache-from: type=gha
  52. cache-to: type=gha,mode=max
  53. tags: ${{ steps.meta.outputs.tags }}
  54. - name: Move cache
  55. run: |
  56. rm -rf /tmp/.buildx-cache
  57. mv /tmp/.buildx-cache-new /tmp/.buildx-cache
  58. - name: Add tag
  59. uses: anothrNick/github-tag-action@v1
  60. env:
  61. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  62. CUSTOM_TAG: v${{ steps.package-json.outputs.packageVersion }}
  63. VERBOSE : true
  64. - name: Update Docker Hub Description
  65. uses: peter-evans/dockerhub-description@v3
  66. with:
  67. username: wsmoogle
  68. password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
  69. repository: weseek/growi-slackbot-proxy
  70. readme-filepath: ./apps/pdf-converter/docker/README.md
  71. create-pr-for-next-rc:
  72. needs: build-and-push-image
  73. runs-on: ubuntu-latest
  74. strategy:
  75. matrix:
  76. node-version: [20.x]
  77. steps:
  78. - uses: actions/checkout@v4
  79. with:
  80. ref: ${{ github.event.pull_request.base.ref }}
  81. - uses: pnpm/action-setup@v4
  82. - uses: actions/setup-node@v4
  83. with:
  84. node-version: ${{ matrix.node-version }}
  85. cache: 'pnpm'
  86. - name: Install dependencies
  87. run: |
  88. pnpm add turbo --global
  89. pnpm install --frozen-lockfile
  90. - name: Bump versions for next RC
  91. run: |
  92. turbo run version:prerelease --filter=@growi/pdf-converter
  93. - name: Retrieve information from package.json
  94. uses: myrotvorets/info-from-package-json-action@2.0.1
  95. id: package-json
  96. with:
  97. workingDir: apps/pdf-converter
  98. - name: Commit
  99. uses: github-actions-x/commit@v2.9
  100. with:
  101. github-token: ${{ secrets.GITHUB_TOKEN }}
  102. push-branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  103. commit-message: 'Bump version'
  104. name: GitHub Action
  105. - name: Create PR
  106. uses: repo-sync/pull-request@v2
  107. with:
  108. source_branch: support/prepare-v${{ steps.package-json.outputs.packageVersion }}
  109. destination_branch: master
  110. pr_title: Prepare v${{ steps.package-json.outputs.packageVersion }}
  111. pr_label: flag/exclude-from-changelog,type/prepare-next-version
  112. pr_body: "An automated PR generated by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
  113. github_token: ${{ secrets.GITHUB_TOKEN }}