-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (107 loc) · 5.81 KB
/
main_churchmanager.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# 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: CI churchManager
on:
push:
branches: [ "main", "master", "ci" ]
pull_request:
branches: [ "main", "master", "ci" ]
env:
IMAGE_NAME: rodolfojesus/church-manager
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
actions: read
checks: read
pull-requests: read
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore API
run: dotnet restore ./Registration/src/Application/Registration.API/Registration.API.csproj
- name: Restore DI
run: dotnet restore ./Registration/src/Service/Registration.DependencyInjection/Registration.DependencyInjection.csproj
- name: Restore Package
run: dotnet restore ./Registration/src/Domain/Registration.CentralPackages/Registration.CentralPackages.csproj
- name: Restore DomainCore
run: dotnet restore ./Registration/src/Domain/Registration.DomainCore/Registration.DomainCore.csproj
- name: Restore DomainBase
run: dotnet restore ./Registration/src/Domain/Registration.DomainBase/Registration.DomainBase.csproj
- name: Restore Handlers
run: dotnet restore ./Registration/src/Service/Registration.Handlers/Registration.Handlers.csproj
- name: Restore Repository
run: dotnet restore ./Registration/src/Repository/Registration.Repository/Registration.Repository.csproj
- name: Restore Resources
run: dotnet restore ./Registration/src/Infrastructure/Registration.Resources/Registration.Resources.csproj
- name: Restore Mapper
run: dotnet restore ./Registration/src/Service/Registration.Mapper/Registration.Mapper.csproj
- name: Restore MessageBroker
run: dotnet restore ./Registration/src/Service/MessageBroker/MessageBroker.csproj
- name: Restore Infrastructure
run: dotnet restore ./Registration/src/Infrastructure/Registration.Infrastructure/Registration.Infrastructure.csproj
- name: Restore CloudServices
run: dotnet restore ./Registration/src/Service/CloudServices/CloudServices.csproj
- name: Build API
run: dotnet build ./Registration/src/Application/Registration.API/Registration.API.csproj --configuration Release
- name: Build DependencyInjection
run: dotnet build ./Registration/src/Service/Registration.DependencyInjection/Registration.DependencyInjection.csproj --configuration Release
- name: Build CentralPackages
run: dotnet build ./Registration/src/Domain/Registration.CentralPackages/Registration.CentralPackages.csproj --configuration Release
- name: Build DomainCore
run: dotnet build ./Registration/src/Domain/Registration.DomainCore/Registration.DomainCore.csproj --configuration Release
- name: Build DomainBase
run: dotnet build ./Registration/src/Domain/Registration.DomainBase/Registration.DomainBase.csproj --configuration Release
- name: Build Handlers
run: dotnet build ./Registration/src/Service/Registration.Handlers/Registration.Handlers.csproj --configuration Release
- name: Build Repository
run: dotnet build ./Registration/src/Repository/Registration.Repository/Registration.Repository.csproj --configuration Release
- name: Build Resources
run: dotnet build ./Registration/src/Infrastructure/Registration.Resources/Registration.Resources.csproj --configuration Release
- name: Build Mapper
run: dotnet build ./Registration/src/Service/Registration.Mapper/Registration.Mapper.csproj --configuration Release
- name: Build MessageBroker
run: dotnet build ./Registration/src/Service/MessageBroker/MessageBroker.csproj --configuration Release
- name: Build Infrastructure
run: dotnet build ./Registration/src/Infrastructure/Registration.Infrastructure/Registration.Infrastructure.csproj --configuration Release
- name: Build CloudServices
run: dotnet build ./Registration/src/Service/CloudServices/CloudServices.csproj --configuration Release
- name: Test
run: dotnet test ./Registration/src/Test/HandlerTest/HandlersTest.csproj
build:
name: Build and publish image
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set BUILD_TAG
run: |
echo BUILD_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed "s,/,_,g")-${{ github.run_number }} >> $GITHUB_ENV
- name: Print BUILD_TAG defined
run: |
echo "Branch ---> ${{ github.head_ref || github.ref_name }}"
echo "Run number ---> ${{ github.run_number }}"
echo "Tag ---> ${{ env.BUILD_TAG }}"
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUBUSERNAME }}
password: ${{ secrets.DOCKERHUBTOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6
with:
context: ./Registration
file: ./Registration/Dockerfile
push: true
tags: ${{ env.IMAGE_NAME }}:${{ env.BUILD_TAG }},${{ env.IMAGE_NAME }}:latest