-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (57 loc) · 2.01 KB
/
dotnet.yml
File metadata and controls
62 lines (57 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# 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:
# - master
tags:
- v*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: env info
run: ls & pwd
- name: cd project
run: cd Src/Server/MoreNote
- name: Get version
id: get_version
run: echo APP_VERSION=`git describe --tags --always` >> $GITHUB_ENV
- name: Restore dependencies
working-directory: Src/MoreNote
run: pwd && ls && dotnet restore
- name: Publish
working-directory: Src/MoreNote
run: dotnet publish -f net8.0 -c Release --self-contained false
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
#- name: Login to Aliyun Container Registry (ACR)
#uses: aliyun/acr-login@v1 # 使用阿里云镜像服务action
#with:
#login-server: registry.cn-shanghai.aliyuncs.com # 务必正确填写镜像容器服务的登录地址
#region-id: cn-shanghai # 务必正确填写镜像容器服务的登录地址
#username: "${{ secrets.REGISTRY_USERNAME }}" # 引用GitHub repo设置的镜像容器服务用户名
#password: "${{ secrets.REGISTRY_PASSWORD }}" # 引用GitHub repo设置的镜像容器服务密码
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./Src/MoreNote
file: ./Src/MoreNote/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
hyfree/morenote:${{env.APP_VERSION}}