1 Commits

Author SHA1 Message Date
pooria.sh babcb85254 update ci
Release Docker Image / build-and-push (release) Failing after 1m10s
Release NuGet Packages / pack-and-push (release) Failing after 3s
2026-05-20 13:53:08 +03:30
3 changed files with 16 additions and 29 deletions
+13 -23
View File
@@ -15,24 +15,16 @@ jobs:
build-and-push: build-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: mcr-mirror.liara.ir/dotnet/sdk:10.0 image: mcr-mirror.liara.ir/dotnet/sdk:9.0
steps: steps:
- name: Checkout - name: Build and push image
uses: actions/checkout@v4
- name: Install Docker CLI
shell: bash
run: |
set -euo pipefail
apt-get update
apt-get install -y docker.io
- name: Login to Harbor
shell: bash shell: bash
env: env:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }} HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }} HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
DOTNET_CONTAINER_REGISTRY_UNAME: ${{ secrets.HARBOR_USERNAME }}
DOTNET_CONTAINER_REGISTRY_PWORD: ${{ secrets.HARBOR_PASSWORD }}
run: | run: |
set -euo pipefail set -euo pipefail
if [ -z "${HARBOR_USERNAME:-}" ] || [ -z "${HARBOR_PASSWORD:-}" ]; then if [ -z "${HARBOR_USERNAME:-}" ] || [ -z "${HARBOR_PASSWORD:-}" ]; then
@@ -40,16 +32,14 @@ jobs:
exit 1 exit 1
fi fi
echo "$HARBOR_PASSWORD" | docker login "$REGISTRY" --username "$HARBOR_USERNAME" --password-stdin
- name: Build and push image
shell: bash
run: |
set -euo pipefail
tag="${RELEASE_TAG:-$REF_NAME}" tag="${RELEASE_TAG:-$REF_NAME}"
tag="${tag#v}" tag="${tag#v}"
image="$REGISTRY/$IMAGE_NAME" dotnet publish DevOpsTest.csproj \
--configuration Release \
docker build --pull -t "$image:$tag" -t "$image:latest" . --os linux \
docker push "$image:$tag" --arch x64 \
docker push "$image:latest" /t:PublishContainer \
-p:ContainerRegistry="$REGISTRY" \
-p:ContainerRepository="$IMAGE_NAME" \
-p:ContainerBaseImage=mcr-mirror.liara.ir/dotnet/aspnet:10.0 \
-p:ContainerImageTags="$tag;latest"
+1 -4
View File
@@ -18,12 +18,9 @@ jobs:
pack-and-push: pack-and-push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: mcr-mirror.liara.ir/dotnet/sdk:10.0 image: mcr-mirror.liara.ir/dotnet/sdk:9.0
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore selected projects - name: Restore selected projects
shell: bash shell: bash
run: | run: |
+2 -2
View File
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build FROM mcr-mirror.liara.ir/dotnet/sdk:10.0 AS build
WORKDIR /src WORKDIR /src
COPY DevOpsTest.csproj ./ COPY DevOpsTest.csproj ./
@@ -13,7 +13,7 @@ RUN dotnet publish DevOpsTest.csproj \
--output /app/publish \ --output /app/publish \
/p:UseAppHost=false /p:UseAppHost=false
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final FROM mcr-mirror.liara.ir/dotnet/aspnet:10.0 AS final
WORKDIR /app WORKDIR /app
ENV ASPNETCORE_URLS=http://+:8080 \ ENV ASPNETCORE_URLS=http://+:8080 \