Merge branch 'main' of https://github.com/codesoroush/Meezi
This commit is contained in:
@@ -10,6 +10,22 @@ concurrency:
|
|||||||
group: meezi-cicd-${{ github.ref }}
|
group: meezi-cicd-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
# HOW THIS WORKS
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
# Runner labels (in gitea docker-compose):
|
||||||
|
# ubuntu-latest:docker://node:20-alpine ← CI jobs run in real Docker containers
|
||||||
|
# self-hosted:host ← deploy runs directly on the server
|
||||||
|
#
|
||||||
|
# All images are pulled from local Nexus mirrors (fast, no internet):
|
||||||
|
# Docker Hub → http://171.22.25.73:5000 (docker-hub-proxy repo)
|
||||||
|
# MCR → http://171.22.25.73:5002 (mcr-proxy repo)
|
||||||
|
#
|
||||||
|
# mirror hostname → host-gateway (docker bridge IP 172.17.0.1) — used for:
|
||||||
|
# NuGet → http://mirror:8081/repository/nuget-group/
|
||||||
|
# npm → http://mirror:8081/repository/npm-group/
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
api-build:
|
api-build:
|
||||||
@@ -52,9 +68,17 @@ jobs:
|
|||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
- name: Write NuGet config
|
- name: Write NuGet config
|
||||||
run: >-
|
run: |
|
||||||
python3 -c
|
cat > /tmp/nuget.ci.config << 'EOF'
|
||||||
"open('/tmp/nuget.ci.config','w').write('<?xml version=\"1.0\" encoding=\"utf-8\"?><configuration><packageSources><clear /><add key=\"nexus\" value=\"http://mirror:8081/repository/nuget-group/index.json\" protocolVersion=\"3\" allowInsecureConnections=\"true\" /></packageSources></configuration>')"
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<clear />
|
||||||
|
<add key="nexus" value="http://mirror:8081/repository/nuget-group/index.json"
|
||||||
|
protocolVersion="3" allowInsecureConnections="true" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Restore
|
- name: Restore
|
||||||
run: dotnet restore src/Meezi.API/Meezi.API.csproj --configfile /tmp/nuget.ci.config
|
run: dotnet restore src/Meezi.API/Meezi.API.csproj --configfile /tmp/nuget.ci.config
|
||||||
@@ -91,9 +115,17 @@ jobs:
|
|||||||
git checkout FETCH_HEAD
|
git checkout FETCH_HEAD
|
||||||
|
|
||||||
- name: Write NuGet config
|
- name: Write NuGet config
|
||||||
run: >-
|
run: |
|
||||||
python3 -c
|
cat > /tmp/nuget.ci.config << 'EOF'
|
||||||
"open('/tmp/nuget.ci.config','w').write('<?xml version=\"1.0\" encoding=\"utf-8\"?><configuration><packageSources><clear /><add key=\"nexus\" value=\"http://mirror:8081/repository/nuget-group/index.json\" protocolVersion=\"3\" allowInsecureConnections=\"true\" /></packageSources></configuration>')"
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<clear />
|
||||||
|
<add key="nexus" value="http://mirror:8081/repository/nuget-group/index.json"
|
||||||
|
protocolVersion="3" allowInsecureConnections="true" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
|
EOF
|
||||||
|
|
||||||
- name: Restore
|
- name: Restore
|
||||||
run: dotnet restore src/Meezi.Admin.API/Meezi.Admin.API.csproj --configfile /tmp/nuget.ci.config
|
run: dotnet restore src/Meezi.Admin.API/Meezi.Admin.API.csproj --configfile /tmp/nuget.ci.config
|
||||||
@@ -227,6 +259,10 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
NEXT_PUBLIC_API_URL: http://localhost:5080
|
NEXT_PUBLIC_API_URL: http://localhost:5080
|
||||||
|
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
# DEPLOY — only on push to main, only if ALL CI jobs pass.
|
||||||
|
# self-hosted:host — runs directly on your server where Docker is installed.
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
deploy:
|
deploy:
|
||||||
name: "Deploy · all services"
|
name: "Deploy · all services"
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ services:
|
|||||||
- nexus-data:/nexus-data
|
- nexus-data:/nexus-data
|
||||||
ports:
|
ports:
|
||||||
- "8081:8081" # Web UI + NuGet + npm REST API
|
- "8081:8081" # Web UI + NuGet + npm REST API
|
||||||
- "5000:5000" # Docker Hub pull-through proxy (httpPort configured in docker-hub-proxy repo)
|
- "5000:5000" # Docker Hub proxy (docker-hub-proxy repo httpPort: 5000)
|
||||||
|
- "5002:5002" # MCR proxy (mcr-proxy repo httpPort: 5002)
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-sf", "http://localhost:8081/service/rest/v1/status"]
|
test: ["CMD", "curl", "-sf", "http://localhost:8081/service/rest/v1/status"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
Reference in New Issue
Block a user