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@v5
  15. with:
  16. submodules: true
  17. - name: Docker meta
  18. id: meta
  19. uses: docker/metadata-action@v5
  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=pep440,pattern={{version}}
  28. - name: Set up QEMU
  29. uses: docker/setup-qemu-action@v3
  30. - name: Set up Docker Buildx
  31. uses: docker/setup-buildx-action@v3
  32. with:
  33. install: true
  34. - name: Login to Docker Hub
  35. uses: docker/login-action@v3
  36. with:
  37. username: ${{ secrets.DOCKER_HUB_USERNAME }}
  38. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  39. - name: Login to GHCR
  40. uses: docker/login-action@v3
  41. with:
  42. registry: ghcr.io
  43. username: ${{ github.repository_owner }}
  44. password: ${{ secrets.GITHUB_TOKEN }}
  45. - name: Build and push Docker image
  46. uses: docker/build-push-action@v6
  47. with:
  48. context: .
  49. push: true
  50. platforms: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/arm/v6, linux/386
  51. tags: ${{ steps.meta.outputs.tags }}
  52. labels: ${{ steps.meta.outputs.labels }}