You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
3.6 KiB

  1. name: Build Latest Containers
  2. on:
  3. push:
  4. branches:
  5. - master
  6. workflow_dispatch: []
  7. jobs:
  8. build-latest:
  9. runs-on: [ubuntu-latest]
  10. strategy:
  11. matrix:
  12. platform: [ linux ]
  13. arch: [ amd64, arm, arm64, 386 ]
  14. steps:
  15. -
  16. name: Checkout
  17. uses: actions/checkout@v2
  18. -
  19. name: Docker meta
  20. id: docker_meta
  21. uses: docker/metadata-action@v3
  22. with:
  23. images: |
  24. chrislusf/seaweedfs
  25. ghcr.io/chrislusf/seaweedfs
  26. tags: |
  27. type=raw,value=latest
  28. labels: |
  29. org.opencontainers.image.title=seaweedfs
  30. org.opencontainers.image.vendor=Chris Lu
  31. -
  32. name: Set up QEMU
  33. uses: docker/setup-qemu-action@v1
  34. -
  35. name: Set up Docker Buildx
  36. uses: docker/setup-buildx-action@v1
  37. with:
  38. buildkitd-flags: "--debug"
  39. -
  40. name: Login to Docker Hub
  41. if: github.event_name != 'pull_request'
  42. uses: docker/login-action@v1
  43. with:
  44. username: ${{ secrets.DOCKER_USERNAME }}
  45. password: ${{ secrets.DOCKER_PASSWORD }}
  46. -
  47. name: Login to GHCR
  48. if: github.event_name != 'pull_request'
  49. uses: docker/login-action@v1
  50. with:
  51. registry: ghcr.io
  52. username: ${{ secrets.GHCR_USERNAME }}
  53. password: ${{ secrets.GHCR_TOKEN }}
  54. -
  55. name: Build
  56. uses: docker/build-push-action@v2
  57. with:
  58. context: ./docker
  59. push: ${{ github.event_name != 'pull_request' }}
  60. file: ./docker/Dockerfile
  61. platforms: ${{ matrix.platform }}/${{ matrix.arch }}
  62. tags: ${{ steps.docker_meta.outputs.tags }}
  63. labels: ${{ steps.docker_meta.outputs.labels }}
  64. build-dev:
  65. runs-on: [ubuntu-latest]
  66. strategy:
  67. matrix:
  68. platform: [ linux ]
  69. arch: [ amd64, arm, arm64, 386 ]
  70. steps:
  71. -
  72. name: Checkout
  73. uses: actions/checkout@v2
  74. -
  75. name: Docker meta
  76. id: docker_meta
  77. uses: docker/metadata-action@v3
  78. with:
  79. images: |
  80. chrislusf/seaweedfs
  81. ghcr.io/chrislusf/seaweedfs
  82. tags: |
  83. type=raw,value=dev
  84. labels: |
  85. org.opencontainers.image.title=seaweedfs
  86. org.opencontainers.image.description=SeaweedFS is a distributed storage system for blobs, objects, files, and data lake, to store and serve billions of files fast!
  87. org.opencontainers.image.vendor=Chris Lu
  88. -
  89. name: Set up QEMU
  90. uses: docker/setup-qemu-action@v1
  91. -
  92. name: Set up Docker Buildx
  93. uses: docker/setup-buildx-action@v1
  94. with:
  95. buildkitd-flags: "--debug"
  96. -
  97. name: Login to Docker Hub
  98. if: github.event_name != 'pull_request'
  99. uses: docker/login-action@v1
  100. with:
  101. username: ${{ secrets.DOCKER_USERNAME }}
  102. password: ${{ secrets.DOCKER_PASSWORD }}
  103. -
  104. name: Login to GHCR
  105. if: github.event_name != 'pull_request'
  106. uses: docker/login-action@v1
  107. with:
  108. registry: ghcr.io
  109. username: ${{ secrets.GHCR_USERNAME }}
  110. password: ${{ secrets.GHCR_TOKEN }}
  111. -
  112. name: Build
  113. uses: docker/build-push-action@v2
  114. with:
  115. context: ./docker
  116. push: ${{ github.event_name != 'pull_request' }}
  117. file: ./docker/Dockerfile.go_build
  118. platforms: ${{ matrix.platform }}/${{ matrix.arch }}
  119. tags: ${{ steps.docker_meta.outputs.tags }}
  120. labels: ${{ steps.docker_meta.outputs.labels }}