github actions

docker build envs
docker image
github actions
This commit is contained in:
serogaq 2024-12-13 13:41:05 +03:00
parent 978b5af865
commit 79655b96ae
No known key found for this signature in database
GPG key ID: 6657A27160536D7E
5 changed files with 11 additions and 13 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -45,7 +45,8 @@
"levels": { "levels": {
"0": { "0": {
"statsUserDownlink": true, "statsUserDownlink": true,
"statsUserUplink": true "statsUserUplink": true,
"statsUserOnline": true
} }
}, },
"system": { "system": {