Update dotnet.yml #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will build a .NET project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
name: .NET | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'Manual trigger deploy' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get current date | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
run: echo "::set-env name=today::$(date +'%Y%m%d%H%M')" | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore dependencies | |
run: dotnet restore ./samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj | |
- name: Dotnet Build | |
run: dotnet build --no-restore ./samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj | |
# - name: Dotnet Test | |
# run: dotnet test --no-build --verbosity normal Abp.RadzenUI.sln | |
- name: Dotnet Publish | |
run: dotnet publish ./samples/CRM.Blazor.Web/CRM.Blazor.Web.csproj /t:PublishContainer -r linux-x64 | |
- name: Login to Docker Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY }} | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get Image Tag | |
env: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | |
run: echo "::set-env name=tag::${{ secrets.DOCKER_REGISTRY }}/${{ secrets.DOCKER_NAMESPACE }}/crmblazorweb" | |
- name: Docker Tag Today | |
run: docker tag crm-blazor-web:latest $tag:$today | |
- name: Docker Push Today Tag | |
run: docker push $tag:$today | |
- name: Docker Tag Latest | |
run: docker tag crm-blazor-web:latest $tag:latest | |
- name: Docker Push Latest Tag | |
run: docker push $tag:latest | |