-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (51 loc) · 1.44 KB
/
build-container-base.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: build-container-base
on:
workflow_call:
inputs:
configuration:
required: true
type: string
default: release
project_file:
required: true
type: string
project_test_file:
required: false
type: string
output_path:
required: false
type: string
dockerfile:
required: true
type: string
tag:
required: true
type: string
jobs:
build_container_base:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: restore
run: dotnet restore ${{ inputs.project_file }}
- name: build
run: dotnet build -c ${{ inputs.configuration }} ${{inputs.project_file }} --no-restore
- name: test
run: dotnet test -c ${{ inputs.configuration }} ${{ inputs.project_test_file }} -l trx -v normal --no-build
if: ${{ inputs.project_test_file != null }}
- name: publish
run: dotnet publish -c ${{ inputs.configuration }} -o ${{ inputs.output_path }}
if: ${{ inputs.output_path != null }}
- name: docker buildx
uses: docker/setup-buildx-action@v1
- name: docker build
uses: docker/build-push-action@v2
with:
context: .
file: ./dockerfiles/${{ inputs.dockerfile }}
push: false
tags: gkama/${{ inputs.tag }}