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
with:
images: |
hsanaeii/3x-ui
ghcr.io/mhsanaei/3x-ui
serogaq/3x-ui
ghcr.io/serogaq/3x-ui
tags: |
type=ref,event=branch
type=ref,event=tag

View file

@ -42,16 +42,16 @@ cd ../../
# Antizapret
case $2 in
0)
ANTIZAPRET="0"
BUILD_WITH_ANTIZAPRET="0"
;;
1)
ANTIZAPRET="1"
BUILD_WITH_ANTIZAPRET="1"
;;
*)
ANTIZAPRET="0"
BUILD_WITH_ANTIZAPRET="0"
;;
esac
if [[ $ANTIZAPRET == "1" ]]; then
if [[ $BUILD_WITH_ANTIZAPRET == "1" ]]; then
wget https://github.com/warexify/antizapret-xray/archive/refs/heads/main.zip
unzip main.zip
mv antizapret-xray-main antizapret-xray

View file

@ -4,7 +4,7 @@
FROM golang:1.23-alpine AS builder
WORKDIR /app
ARG TARGETARCH
ARG ANTIZAPRET
ARG BUILD_WITH_ANTIZAPRET
RUN apk --no-cache --update add \
build-base \
@ -17,7 +17,7 @@ COPY . .
ENV CGO_ENABLED=1
ENV CGO_CFLAGS="-D_LARGEFILE64_SOURCE"
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

View file

@ -1,10 +1,7 @@
---
services:
ui:
build:
context: .
args:
ANTIZAPRET: "${BUILD_WITH_ANTIZAPRET:-0}"
image: ghcr.io/serogaq/3x-ui:latest
deploy:
resources:
limits:

View file

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