build-lite-image.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: 构建lite镜像
  2. on:
  3. push:
  4. tags:
  5. - v*.*.*
  6. - v*.*-Beta*
  7. - v*.*-ExeBeta*
  8. workflow_dispatch:
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. if: "!contains(github.ref, 'ExeBeta')"
  13. name: 构建lite镜像
  14. steps:
  15. -
  16. name: Checkout
  17. uses: actions/checkout@master
  18. -
  19. name: Prepare
  20. id: prepare
  21. run: |
  22. echo "::set-output name=version::${GITHUB_REF:10}"
  23. echo "version=${GITHUB_REF:10}"
  24. -
  25. name: Set Up QEMU
  26. uses: docker/setup-qemu-action@v2
  27. -
  28. name: Set Up Buildx
  29. uses: docker/setup-buildx-action@v2
  30. -
  31. name: Login DockerHub
  32. uses: docker/login-action@v2
  33. with:
  34. username: ${{ secrets.DOCKER_USERNAME }}
  35. password: ${{ secrets.DOCKER_PASSWORD }}
  36. -
  37. name: Go Build
  38. working-directory: docker
  39. run: |
  40. docker run --rm -e VERSION=${{ steps.prepare.outputs.version }} -v $(pwd)/go:/root/go -v $(pwd)/lite-init.sh:/init.sh --entrypoint "/init.sh" nevinee/csf-cross-builder
  41. -
  42. name: Docker Buildx Latest Image
  43. if: "!contains(steps.prepare.outputs.version, 'Beta')"
  44. uses: docker/build-push-action@v3
  45. with:
  46. context: docker
  47. file: docker/lite-release.Dockerfile
  48. platforms: |
  49. linux/386
  50. linux/amd64
  51. linux/arm64
  52. linux/arm/v7
  53. push: true
  54. build-args: |
  55. VERSION=${{ steps.prepare.outputs.version }}
  56. tags: |
  57. ${{ secrets.DOCKER_USERNAME }}/chinesesubfinder:${{ steps.prepare.outputs.version }}-lite
  58. ${{ secrets.DOCKER_USERNAME }}/chinesesubfinder:latest-lite
  59. -
  60. name: Docker Buildx Beta Image
  61. if: contains(steps.prepare.outputs.version, 'Beta')
  62. uses: docker/build-push-action@v3
  63. with:
  64. context: docker
  65. file: docker/lite-release.Dockerfile
  66. platforms: |
  67. linux/386
  68. linux/amd64
  69. linux/arm64
  70. linux/arm/v7
  71. push: true
  72. build-args: |
  73. VERSION=${{ steps.prepare.outputs.version }}
  74. tags: |
  75. ${{ secrets.DOCKER_USERNAME }}/chinesesubfinder:${{ steps.prepare.outputs.version }}-lite