First Produciton Attempt
All checks were successful
CI Build and Deploy / build (push) Successful in 4m13s

This commit is contained in:
Grae Jones
2026-03-17 18:23:32 -07:00
parent 6e888cf7a8
commit 967f04ebbc
9 changed files with 157 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
name: CI Test
name: CI Build and Deploy
on:
push:
@@ -6,14 +6,37 @@ on:
- master
jobs:
test:
build:
runs-on: host
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Say hello
run: echo "CI runner is working!"
- name: Build
run: dotnet build AdPlatformServers.sln --configuration Release
run: dotnet build AdPlatformServers.sln --configuration Release
- name: Build Images
run: |
podman build -t adplatform/gateway:latest -f Gateway/Dockerfile .
podman build -t adplatform/management:latest -f Management/Dockerfile .
podman build -t adplatform/creative:latest -f Creative/Dockerfile .
podman build -t adplatform/googleapi:latest -f GoogleApi/Dockerfile .
podman build -t adplatform/intelligenceapi:latest -f IntelligenceApi/Dockerfile .
podman build -t adplatform/metaapi:latest -f MetaApi/Dockerfile .
podman build -t adplatform/tiktokapi:latest -f TikTokApi/Dockerfile .
podman build -t adplatform/registration:latest -f Registration/Dockerfile .
- name: Transfer Images to App Server
run: |
podman save adplatform/gateway:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/management:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/creative:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/googleapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/intelligenceapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/metaapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/tiktokapi:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
podman save adplatform/registration:latest | ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "podman load"
- name: Deploy on App Server
run: |
ssh -i ~/.ssh/gitea_runner root@10.10.25.211 "cd /opt/adplatform && podman-compose down && podman-compose up -d"

16
Creative/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Creative/Creative.csproj", "Creative/"]
RUN dotnet restore "Creative/Creative.csproj"
COPY . .
WORKDIR "/src/Creative"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Creative.dll"]

16
Gateway/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Gateway/Gateway.csproj", "Gateway/"]
RUN dotnet restore "Gateway/Gateway.csproj"
COPY . .
WORKDIR "/src/Gateway"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Gateway.dll"]

16
GoogleApi/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["GoogleApi/GoogleApi.csproj", "GoogleApi/"]
RUN dotnet restore "GoogleApi/GoogleApi.csproj"
COPY . .
WORKDIR "/src/GoogleApi"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "GoogleApi.dll"]

View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["IntelligenceApi/IntelligenceApi.csproj", "IntelligenceApi/"]
RUN dotnet restore "IntelligenceApi/IntelligenceApi.csproj"
COPY . .
WORKDIR "/src/IntelligenceApi"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "IntelligenceApi.dll"]

16
Management/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Management/Management.csproj", "Management/"]
RUN dotnet restore "Management/Management.csproj"
COPY . .
WORKDIR "/src/Management"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Management.dll"]

16
MetaApi/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["MetaApi/MetaApi.csproj", "MetaApi/"]
RUN dotnet restore "MetaApi/MetaApi.csproj"
COPY . .
WORKDIR "/src/MetaApi"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "MetaApi.dll"]

16
Registration/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Registration/Registration.csproj", "Registration/"]
RUN dotnet restore "Registration/Registration.csproj"
COPY . .
WORKDIR "/src/Registration"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Registration.dll"]

16
TikTokApi/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["TikTokApi/TikTokApi.csproj", "TikTokApi/"]
RUN dotnet restore "TikTokApi/TikTokApi.csproj"
COPY . .
WORKDIR "/src/TikTokApi"
RUN dotnet publish -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "TikTokApi.dll"]