diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000000..a9a86e1d0b --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,56 @@ +name: Docker Image CI + +on: + push: + branches: [ main ] +# pull_request: +# branches: [ main ] + +# jobs: + +# build: + +# runs-on: ubuntu-latest + +# steps: +# - uses: actions/checkout@v3 +# - name: Build the Docker image +# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + +jobs: + + Docker: + + runs-on: ubuntu-latest + + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - uses: docker/setup-qemu-action@v1 + + - uses: docker/setup-buildx-action@v1 + + - uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - uses: docker/metadata-action@v3 + id: meta + with: + images: techfever/x-ui + flavor: | + latest=auto + tags: | + type=edge,branch=main + type=match,pattern=v(.*),group=0 + type=ref,event=pr + + - name: Build and push Docker images + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} diff --git a/README.md b/README.md index 80a9e302df..2c5afd4353 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ docker run -itd --network=host \ -v $PWD/db/:/etc/x-ui/ \ -v $PWD/cert/:/root/cert/ \ --name x-ui --restart=unless-stopped \ - enwaiax/x-ui:latest + techfever/x-ui:edge ``` > Build 自己的镜像