1
0

docker.yml 1.3 KB

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