1
0

docker.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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-20.04
  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. with:
  30. install: true
  31. - name: Login to Docker Hub
  32. uses: docker/login-action@v3
  33. with:
  34. username: ${{ secrets.DOCKER_HUB_USERNAME }}
  35. password: ${{ secrets.DOCKER_HUB_TOKEN }}
  36. - name: Login to GHCR
  37. uses: docker/login-action@v3
  38. with:
  39. registry: ghcr.io
  40. username: ${{ github.repository_owner }}
  41. password: ${{ secrets.GITHUB_TOKEN }}
  42. - name: Build and push Docker image
  43. uses: docker/build-push-action@v6
  44. with:
  45. context: .
  46. push: true
  47. platforms: linux/amd64, linux/arm64/v8, linux/arm/v7, linux/arm/v6, linux/386
  48. tags: ${{ steps.meta.outputs.tags }}
  49. labels: ${{ steps.meta.outputs.labels }}