39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: dotnet-publish-nuget
|
|
on: [push]
|
|
|
|
env:
|
|
DOTNET_VERSION: 8.x
|
|
jobs:
|
|
Pack-And-Publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: List files in the repos
|
|
run: ls ${{ gitea.workspace }}
|
|
- name: Setup .NET Core
|
|
uses: actions/setup-dotnet@v1
|
|
with:
|
|
dotnet-version: ${{ env.DOTNET_VERSION }}
|
|
cache: true
|
|
- name: Install dependencies
|
|
run: dotnet restore -s https://api.nuget.org/v3/index.json
|
|
- name: Build
|
|
run: dotnet build --configuration Release --no-restore -o dst
|
|
- name: Test
|
|
run: dotnet test --no-restore --verbosity normal
|
|
- name: List files in the repos
|
|
run: ls ${{ gitea.workspace }}/dst
|
|
- name: Login to Aliyun Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: registry.cn-guangzhou.aliyuncs.com
|
|
username: ${{ secrets.DOCKERHUB_NROP_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_NROP_PASSWORD }}
|
|
- name: Build docker image and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
push: true
|
|
tags: acme_nrop/dotnet-deploy-k8s:${{ gitea.sha }}
|