reusable-app-build-image.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Reusable build app container image workflow
  2. on:
  3. workflow_call:
  4. inputs:
  5. source-version:
  6. type: string
  7. default: ${{ github.sha }}
  8. image-name:
  9. type: string
  10. default: growilabs/growi
  11. tag-temporary:
  12. type: string
  13. default: latest
  14. secrets:
  15. AWS_ROLE_TO_ASSUME_FOR_OIDC:
  16. required: true
  17. jobs:
  18. build-image:
  19. runs-on: ubuntu-latest
  20. # These permissions are needed to interact with GitHub's OIDC Token endpoint.
  21. permissions:
  22. id-token: write
  23. contents: write
  24. strategy:
  25. matrix:
  26. platform: [amd64, arm64]
  27. steps:
  28. - uses: actions/checkout@v4
  29. - name: Configure AWS Credentials
  30. uses: aws-actions/configure-aws-credentials@v4
  31. with:
  32. aws-region: ap-northeast-1
  33. role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME_FOR_OIDC }}
  34. role-session-name: GitHubActions-SessionForReleaseGROWI-${{ github.run_id }}
  35. - name: Run CodeBuild
  36. uses: dark-mechanicum/aws-codebuild@v1
  37. with:
  38. projectName: growi-official-image-builder
  39. env:
  40. CODEBUILD__sourceVersion: ${{ inputs.source-version }}
  41. CODEBUILD__imageOverride: ${{ (matrix.platform == 'amd64' && 'aws/codebuild/amazonlinux2-x86_64-standard:5.0') || 'aws/codebuild/amazonlinux2-aarch64-standard:3.0' }}
  42. CODEBUILD__environmentTypeOverride: ${{ (matrix.platform == 'amd64' && 'LINUX_CONTAINER') || 'ARM_CONTAINER' }}
  43. CODEBUILD__environmentVariablesOverride: '[
  44. { "name": "IMAGE_TAG", "type": "PLAINTEXT", "value": "docker.io/${{ inputs.image-name }}:${{ inputs.tag-temporary }}-${{ matrix.platform }}" }
  45. ]'