Skip to content

Commit d776ea9

Browse files
committed
[NEW] added nexus
1 parent 1814e6b commit d776ea9

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

.github/workflows/ci-cd.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ jobs:
4040
username: ${{ github.actor }}
4141
password: ${{ secrets.GITHUB_TOKEN }}
4242

43+
- name: Replace Nexus Credentials in NuGet.Config
44+
run: |
45+
sed -i "s|__NEXUS_USER__|${{ secrets.NEXUS_USER }}|g" Nuget.Config
46+
sed -i "s|__NEXUS_PASSWORD__|${{ secrets.NEXUS_PASSWORD }}|g" Nuget.Config
47+
4348
- name: Build and push API Docker image
4449
uses: docker/build-push-action@v5
4550
with:
@@ -82,4 +87,4 @@ jobs:
8287
docker rm "${{ env.UI_CONTAINER_NAME }}" || true
8388
docker rm "${{ env.API_CONTAINER_NAME }}" || true
8489
docker run -d --name "${{ env.API_CONTAINER_NAME }}" --restart=always -p "${{ env.API_PORT }}" "${{ env.REGISTRY }}/${{ env.REPO_NAME}}/${{ env.API_IMAGE_NAME }}:${{ github.sha }}"
85-
docker run -d --name "${{ env.UI_CONTAINER_NAME }}" --restart=always -p "${{ env.UI_PORT }}" "${{ env.REGISTRY }}/${{ env.REPO_NAME}}/${{ env.UI_IMAGE_NAME }}:${{ github.sha }}"
90+
docker run -d --name "${{ env.UI_CONTAINER_NAME }}" --restart=always -p "${{ env.UI_PORT }}" "${{ env.REGISTRY }}/${{ env.REPO_NAME}}/${{ env.UI_IMAGE_NAME }}:${{ github.sha }}"

API.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
22
WORKDIR /app
3+
4+
COPY NuGet.Config /root/.nuget/NuGet/NuGet.Config
35
COPY . .
46
WORKDIR "/app/GitHub.Actions.API"
57
RUN dotnet publish "GitHub.Actions.API.csproj" -o /app/build -c Release

NuGet.Config

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<configuration>
2+
<packageSources>
3+
<clear />
4+
<add key="Nexus" value="https://nexus.helm.uz/repository/nuget-group/index.json" />
5+
</packageSources>
6+
<packageSourceCredentials>
7+
<Nexus>
8+
<add key="Username" value="__NEXUS_USER__" />
9+
<add key="ClearTextPassword" value="__NEXUS_PASSWORD__" />
10+
</Nexus>
11+
</packageSourceCredentials>
12+
</configuration>

UI.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
22
WORKDIR /app
3+
4+
COPY NuGet.Config /root/.nuget/NuGet/NuGet.Config
35
COPY . .
46
RUN dotnet restore "GitHub.Actions/GitHub.Actions.csproj"
57
WORKDIR "/app/GitHub.Actions"

0 commit comments

Comments
 (0)