reusable-app-create-manifests.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Reusable create app container image manifests workflow
  2. on:
  3. workflow_call:
  4. inputs:
  5. tags:
  6. type: string
  7. required: true
  8. registry:
  9. type: string
  10. default: 'docker.io'
  11. image-name:
  12. type: string
  13. default: weseek/growi
  14. tag-temporary:
  15. type: string
  16. default: latest
  17. secrets:
  18. DOCKER_REGISTRY_PASSWORD:
  19. required: true
  20. DOCKER_REGISTRY_ON_GITHUB_PASSWORD:
  21. required: true
  22. jobs:
  23. create-manifest:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - uses: actions/checkout@v3
  27. - name: Docker meta for extra-images
  28. id: meta-extra-images
  29. uses: docker/metadata-action@v4
  30. with:
  31. images: ${{ inputs.registry }}/${{ inputs.image-name }}
  32. sep-tags: ','
  33. tags: |
  34. type=raw,value=${{ inputs.tag-temporary }}-amd64
  35. type=raw,value=${{ inputs.tag-temporary }}-arm64
  36. - name: Login to Container Registry
  37. uses: docker/login-action@v2
  38. with:
  39. registry: ${{ inputs.registry }}
  40. username: wsmoogle
  41. password: ${{ (startsWith(matrix.registry, 'docker') && secrets.DOCKER_REGISTRY_PASSWORD) || secrets.DOCKER_REGISTRY_ON_GITHUB_PASSWORD }}
  42. - name: Create and push manifest images
  43. uses: Noelware/docker-manifest-action@master
  44. with:
  45. base-image: ${{ inputs.tags }}
  46. extra-images: ${{ steps.meta-extra-images.outputs.tags }}
  47. push: true