qBittorrent.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. name: qBittorrent
  2. on:
  3. push:
  4. paths:
  5. - 'qBittorrent/Dockerfile'
  6. - 'qBittorrent/Dockerfile.qb'
  7. - 'qBittorrent/Dockerfile.qbee'
  8. - 'qBittorrent/root/**'
  9. workflow_dispatch:
  10. jobs:
  11. job1:
  12. name: buildx tag
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Checkout
  16. uses: actions/checkout@v4
  17. - name: 'Set env'
  18. run: |
  19. echo "QBITTORRENT_VER=$(echo `grep -n "QBITTORRENT_VER=" qBittorrent/Dockerfile.qb`|awk -F= '{print $2}')" >> $GITHUB_ENV
  20. - name: Set up QEMU
  21. id: qemu
  22. uses: docker/setup-qemu-action@v3
  23. with:
  24. platforms: all
  25. - name: Set up Docker Buildx
  26. id: buildx
  27. uses: docker/setup-buildx-action@v3
  28. with:
  29. version: latest
  30. - name: Login to GHCR
  31. uses: docker/login-action@v3
  32. with:
  33. registry: ghcr.io
  34. username: ${{ github.actor }}
  35. password: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Check image exist
  37. id: qb-check-step
  38. run: |
  39. if [ `DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect ghcr.io/gshang2017/qbittorrent-nox:${{ env.QBITTORRENT_VER }} > /dev/null 2>&1; echo $?` == "0" ];then echo "skipnext=true" >> $GITHUB_OUTPUT;fi
  40. - name: Build and push
  41. if : ( steps.qb-check-step.outputs.skipnext != 'true' )
  42. uses: docker/build-push-action@v6
  43. with:
  44. context: ./qBittorrent
  45. file: ./qBittorrent/Dockerfile.qb
  46. platforms: linux/amd64,linux/arm64,linux/arm/v7
  47. push: true
  48. tags: |
  49. ghcr.io/gshang2017/qbittorrent-nox:latest
  50. ghcr.io/gshang2017/qbittorrent-nox:${{ env.QBITTORRENT_VER }}
  51. job2:
  52. name: buildx tag
  53. runs-on: ubuntu-latest
  54. steps:
  55. - name: Checkout
  56. uses: actions/checkout@v4
  57. - name: 'Set env'
  58. run: |
  59. echo "QBITTORRENT_EE_VER=$(echo `grep -n "QBITTORRENT_EE_VER=" qBittorrent/Dockerfile.qbee`|awk -F= '{print $2}')" >> $GITHUB_ENV
  60. - name: Set up QEMU
  61. id: qemu
  62. uses: docker/setup-qemu-action@v3
  63. with:
  64. platforms: all
  65. - name: Set up Docker Buildx
  66. id: buildx
  67. uses: docker/setup-buildx-action@v3
  68. with:
  69. version: latest
  70. - name: Login to GHCR
  71. uses: docker/login-action@v3
  72. with:
  73. registry: ghcr.io
  74. username: ${{ github.actor }}
  75. password: ${{ secrets.GITHUB_TOKEN }}
  76. - name: Check image exist
  77. id: qbee-check-step
  78. run: |
  79. if [ `DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect ghcr.io/gshang2017/qbittorrentee-nox:${{ env.QBITTORRENT_EE_VER }} > /dev/null 2>&1; echo $?` == "0" ];then echo "skipnext=true" >> $GITHUB_OUTPUT;fi
  80. - name: Build and push
  81. if : ( steps.qbee-check-step.outputs.skipnext != 'true' )
  82. uses: docker/build-push-action@v6
  83. with:
  84. context: ./qBittorrent
  85. file: ./qBittorrent/Dockerfile.qbee
  86. platforms: linux/amd64,linux/arm64,linux/arm/v7
  87. push: true
  88. tags: |
  89. ghcr.io/gshang2017/qbittorrentee-nox:latest
  90. ghcr.io/gshang2017/qbittorrentee-nox:${{ env.QBITTORRENT_EE_VER }}
  91. job3:
  92. needs: [job1, job2]
  93. name: buildx tag
  94. runs-on: ubuntu-latest
  95. steps:
  96. - name: Checkout
  97. uses: actions/checkout@v4
  98. - name: 'Set env'
  99. run: |
  100. echo "QBITTORRENT_VER=$(echo `grep -n "QBITTORRENT_VER=" qBittorrent/Dockerfile.qb`|awk -F= '{print $2}')" >> $GITHUB_ENV
  101. echo "QBITTORRENT_EE_VER=$(echo `grep -n "QBITTORRENT_EE_VER=" qBittorrent/Dockerfile.qbee`|awk -F= '{print $2}')" >> $GITHUB_ENV
  102. - name: Set up QEMU
  103. id: qemu
  104. uses: docker/setup-qemu-action@v3
  105. with:
  106. platforms: all
  107. - name: Set up Docker Buildx
  108. id: buildx
  109. uses: docker/setup-buildx-action@v3
  110. with:
  111. version: latest
  112. - name: Login to DockerHub
  113. uses: docker/login-action@v3
  114. with:
  115. username: ${{ secrets.DOCKER_USERNAME }}
  116. password: ${{ secrets.DOCKER_PASSWORD }}
  117. - name: Login to GHCR
  118. uses: docker/login-action@v3
  119. with:
  120. registry: ghcr.io
  121. username: ${{ github.actor }}
  122. password: ${{ secrets.GITHUB_TOKEN }}
  123. - name: Build and push
  124. uses: docker/build-push-action@v6
  125. with:
  126. context: ./qBittorrent
  127. file: ./qBittorrent/Dockerfile
  128. platforms: linux/amd64,linux/arm64,linux/arm/v7
  129. push: true
  130. tags: |
  131. johngong/qbittorrent:latest
  132. johngong/qbittorrent:${{ env.QBITTORRENT_VER }}-${{ env.QBITTORRENT_EE_VER }}
  133. ghcr.io/gshang2017/qbittorrent:latest
  134. ghcr.io/gshang2017/qbittorrent:${{ env.QBITTORRENT_VER }}-${{ env.QBITTORRENT_EE_VER }}
  135. - name: Docker Hub Description
  136. uses: peter-evans/dockerhub-description@v3
  137. with:
  138. username: ${{ secrets.DOCKER_USERNAME }}
  139. password: ${{ secrets.DOCKER_PASSWORD }}
  140. repository: johngong/qbittorrent
  141. short-description: qBittorrent:${{ env.QBITTORRENT_VER }},qBittorrent-EE:${{ env.QBITTORRENT_EE_VER }},集成Trackers更新
  142. readme-filepath: ./qBittorrent/README.md