-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.35 KB
/
ExampleApp-CI.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
42
43
44
45
name: ExampleApp-CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v4.1.1
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore
run: dotnet restore --verbosity minimal ./src/ExampleApp.csproj
- name: Build
run: dotnet build --no-restore --configuration Release --verbosity normal ./src/ExampleApp.csproj
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal ./src/ExampleApp.csproj
- name: Publish
run: dotnet publish --no-build --configuration Release --verbosity normal ./src/ExampleApp.csproj
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ExampleApp
path: ./src/bin/Release/net6.0/publish
- name: Login to DockerHub
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Build and push to Docker Hub
uses: docker/build-push-action@v5.0.0
with:
context: ./src
file: ./src/Dockerfile
push: true
tags: feliperomero/exampleapp:dev