mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-07-01 12:32:09 +00:00
github actions
docker build envs docker image github actions
This commit is contained in:
parent
978b5af865
commit
79655b96ae
5 changed files with 11 additions and 13 deletions
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
@ -19,8 +19,8 @@ jobs:
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
hsanaeii/3x-ui
|
serogaq/3x-ui
|
||||||
ghcr.io/mhsanaei/3x-ui
|
ghcr.io/serogaq/3x-ui
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=tag
|
type=ref,event=tag
|
||||||
|
|
|
@ -42,16 +42,16 @@ cd ../../
|
||||||
# Antizapret
|
# Antizapret
|
||||||
case $2 in
|
case $2 in
|
||||||
0)
|
0)
|
||||||
ANTIZAPRET="0"
|
BUILD_WITH_ANTIZAPRET="0"
|
||||||
;;
|
;;
|
||||||
1)
|
1)
|
||||||
ANTIZAPRET="1"
|
BUILD_WITH_ANTIZAPRET="1"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
ANTIZAPRET="0"
|
BUILD_WITH_ANTIZAPRET="0"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
if [[ $ANTIZAPRET == "1" ]]; then
|
if [[ $BUILD_WITH_ANTIZAPRET == "1" ]]; then
|
||||||
wget https://github.com/warexify/antizapret-xray/archive/refs/heads/main.zip
|
wget https://github.com/warexify/antizapret-xray/archive/refs/heads/main.zip
|
||||||
unzip main.zip
|
unzip main.zip
|
||||||
mv antizapret-xray-main antizapret-xray
|
mv antizapret-xray-main antizapret-xray
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
FROM golang:1.23-alpine AS builder
|
FROM golang:1.23-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG ANTIZAPRET
|
ARG BUILD_WITH_ANTIZAPRET
|
||||||
|
|
||||||
RUN apk --no-cache --update add \
|
RUN apk --no-cache --update add \
|
||||||
build-base \
|
build-base \
|
||||||
|
@ -17,7 +17,7 @@ COPY . .
|
||||||
ENV CGO_ENABLED=1
|
ENV CGO_ENABLED=1
|
||||||
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
|
||||||
RUN go build -o build/x-ui main.go
|
RUN go build -o build/x-ui main.go
|
||||||
RUN ./DockerInit.sh "$TARGETARCH" "$ANTIZAPRET"
|
RUN ./DockerInit.sh "$TARGETARCH" "$BUILD_WITH_ANTIZAPRET"
|
||||||
|
|
||||||
# ========================================================
|
# ========================================================
|
||||||
# Stage: Final Image of 3x-ui
|
# Stage: Final Image of 3x-ui
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
---
|
---
|
||||||
services:
|
services:
|
||||||
ui:
|
ui:
|
||||||
build:
|
image: ghcr.io/serogaq/3x-ui:latest
|
||||||
context: .
|
|
||||||
args:
|
|
||||||
ANTIZAPRET: "${BUILD_WITH_ANTIZAPRET:-0}"
|
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
|
|
|
@ -45,7 +45,8 @@
|
||||||
"levels": {
|
"levels": {
|
||||||
"0": {
|
"0": {
|
||||||
"statsUserDownlink": true,
|
"statsUserDownlink": true,
|
||||||
"statsUserUplink": true
|
"statsUserUplink": true,
|
||||||
|
"statsUserOnline": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"system": {
|
"system": {
|
||||||
|
|
Loading…
Reference in a new issue