1
0

docker.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Release 3X-UI for Docker
  2. permissions:
  3. contents: read
  4. packages: write
  5. on:
  6. workflow_dispatch:
  7. push:
  8. tags:
  9. - "v*.*.*"
  10. jobs:
  11. build:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v6
  15. with:
  16. submodules: true
  17. - name: Docker meta
  18. id: meta
  19. uses: docker/metadata-action@v6
  20. with:
  21. images: |
  22. hsanaeii/3x-ui
  23. ghcr.io/mhsanaei/3x-ui
  24. tags: |
  25. type=ref,event=branch
  26. type=ref,event=tag
  27. type=semver,pattern={{version}}
  28. - name: Set up QEMU
  29. uses: docker/setup-qemu-action@v4
  30. - name: Set up Docker Buildx
  31. uses: docker/setup-buildx-action@v4
  32. - name: Login to Docker Hub
  33. uses: docker/login-action@v4
  34. with:
  35. username: ${{ secrets.DOCKER_HUB_USERNAME }}
  36. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  37. - name: Login to GHCR
  38. uses: docker/login-action@v4
  39. with:
  40. registry: ghcr.io
  41. username: ${{ github.actor }}
  42. password: ${{ secrets.GITHUB_TOKEN }}
  43. - name: Build and push Docker image
  44. uses: docker/build-push-action@v7
  45. with:
  46. context: .
  47. push: true
  48. platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6,linux/386
  49. tags: ${{ steps.meta.outputs.tags }}
  50. labels: ${{ steps.meta.outputs.labels }}