-
Notifications
You must be signed in to change notification settings - Fork 17
41 lines (36 loc) · 981 Bytes
/
dotnetcore.yml
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
name: Publish CodeIndex
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
- name: Install dependencies
run: |
cd src
dotnet restore
- name: Build CodeIndex
run: dotnet build src/CodeIndex.sln --configuration Release --no-restore
- name: Test CodeIndex
run: |
cd src
dotnet test --no-restore --verbosity normal
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push the Docker image
run: |
cd src
docker build -f CodeIndex.Server/Dockerfile -t qiuhaotc/codeindex:latest .
docker push qiuhaotc/codeindex