Skip to content

Commit 7e4820b

Browse files
chore: this commit refactor ci/cd pipelines
1 parent 9640d19 commit 7e4820b

6 files changed

Lines changed: 254 additions & 146 deletions

.github/workflows/production-deployment-pipeline.yml

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,91 +8,91 @@ jobs:
88
changes:
99
runs-on: ubuntu-latest
1010
outputs:
11-
subscriptions: ${{ steps.filter.outputs.subscriptions }}
12-
stores: ${{ steps.filter.outputs.stores }}
13-
profiles: ${{ steps.filter.outputs.profiles }}
14-
payments: ${{ steps.filter.outputs.payments }}
15-
orders: ${{ steps.filter.outputs.orders }}
16-
orchestrator: ${{ steps.filter.outputs.orchestrator }}
11+
comanda_boundaries_orchestrator: ${{ steps.filter.outputs.comanda_boundaries_orchestrator }}
12+
comanda_boundaries_orders: ${{ steps.filter.outputs.comanda_boundaries_orders }}
13+
comanda_boundaries_payments: ${{ steps.filter.outputs.comanda_boundaries_payments }}
14+
comanda_boundaries_profiles: ${{ steps.filter.outputs.comanda_boundaries_profiles }}
15+
comanda_boundaries_stores: ${{ steps.filter.outputs.comanda_boundaries_stores }}
16+
comanda_boundaries_subscriptions: ${{ steps.filter.outputs.comanda_boundaries_subscriptions }}
1717

1818
steps:
1919
- name: checkout
2020
uses: actions/checkout@v4
2121

2222
- name: detect changed paths
2323
id: filter
24-
uses: dorny/paths-filter@v3
24+
uses: dorny/paths-filter@v4
2525
with:
2626
filters: |
27-
subscriptions:
28-
- 'Boundaries/Comanda.Subscriptions/**'
29-
stores:
30-
- 'Boundaries/Comanda.Stores/**'
31-
profiles:
32-
- 'Boundaries/Comanda.Profiles/**'
33-
payments:
34-
- 'Boundaries/Comanda.Payments/**'
35-
orders:
36-
- 'Boundaries/Comanda.Orders/**'
37-
orchestrator:
27+
comanda_boundaries_orchestrator:
3828
- 'Boundaries/Comanda.Orchestrator/**'
29+
comanda_boundaries_orders:
30+
- 'Boundaries/Comanda.Orders/**'
31+
comanda_boundaries_payments:
32+
- 'Boundaries/Comanda.Payments/**'
33+
comanda_boundaries_profiles:
34+
- 'Boundaries/Comanda.Profiles/**'
35+
comanda_boundaries_stores:
36+
- 'Boundaries/Comanda.Stores/**'
37+
comanda_boundaries_subscriptions:
38+
- 'Boundaries/Comanda.Subscriptions/**'
3939
40-
deploy-subscriptions:
40+
deploy-comanda-orchestrator:
4141
needs: changes
42-
if: needs.changes.outputs.subscriptions == 'true'
43-
uses: ./.github/workflows/reusable-production-deployment.yml
42+
if: needs.changes.outputs.comanda_boundaries_orchestrator == 'true'
43+
uses: ./.github/workflows/template-deployment.yml
4444
with:
45-
service_path: Boundaries/Comanda.Subscriptions
46-
image_name: httpsrichardy/comanda.subscriptions
47-
deploy_url_secret: SUBSCRIPTIONS_PRODUCTION_DEPLOY_URL
45+
service_path: Boundaries/Comanda.Orchestrator
46+
image_name: httpsrichardy/comanda.orchestrator
47+
deploy_url_secret: ORCHESTRATOR_PRODUCTION_DEPLOY_WEBHOOK_URL
4848
secrets: inherit
4949

50-
deploy-stores:
50+
deploy-comanda-orders:
5151
needs: changes
52-
if: needs.changes.outputs.stores == 'true'
53-
uses: ./.github/workflows/reusable-production-deployment.yml
52+
if: needs.changes.outputs.comanda_boundaries_orders == 'true'
53+
uses: ./.github/workflows/template-deployment.yml
5454
with:
55-
service_path: Boundaries/Comanda.Stores
56-
image_name: httpsrichardy/comanda.stores
57-
deploy_url_secret: STORES_PRODUCTION_DEPLOY_URL
55+
service_path: Boundaries/Comanda.Orders
56+
image_name: httpsrichardy/comanda.orders
57+
deploy_url_secret: ORDERS_PRODUCTION_DEPLOY_WEBHOOK_URL
5858
secrets: inherit
5959

60-
deploy-profiles:
60+
deploy-comanda-payments:
6161
needs: changes
62-
if: needs.changes.outputs.profiles == 'true'
63-
uses: ./.github/workflows/reusable-production-deployment.yml
62+
if: needs.changes.outputs.comanda_boundaries_payments == 'true'
63+
uses: ./.github/workflows/template-deployment.yml
6464
with:
65-
service_path: Boundaries/Comanda.Profiles
66-
image_name: httpsrichardy/comanda.profiles
67-
deploy_url_secret: PROFILES_PRODUCTION_DEPLOY_URL
65+
service_path: Boundaries/Comanda.Payments
66+
image_name: httpsrichardy/comanda.payments
67+
deploy_url_secret: PAYMENTS_PRODUCTION_DEPLOY_WEBHOOK_URL
6868
secrets: inherit
6969

70-
deploy-payments:
70+
deploy-comanda-profiles:
7171
needs: changes
72-
if: needs.changes.outputs.payments == 'true'
73-
uses: ./.github/workflows/reusable-production-deployment.yml
72+
if: needs.changes.outputs.comanda_boundaries_profiles == 'true'
73+
uses: ./.github/workflows/template-deployment.yml
7474
with:
75-
service_path: Boundaries/Comanda.Payments
76-
image_name: httpsrichardy/comanda.payments
77-
deploy_url_secret: PAYMENTS_PRODUCTION_DEPLOY_URL
75+
service_path: Boundaries/Comanda.Profiles
76+
image_name: httpsrichardy/comanda.profiles
77+
deploy_url_secret: PROFILES_PRODUCTION_DEPLOY_WEBHOOK_URL
7878
secrets: inherit
7979

80-
deploy-orders:
80+
deploy-comanda-stores:
8181
needs: changes
82-
if: needs.changes.outputs.orders == 'true'
83-
uses: ./.github/workflows/reusable-production-deployment.yml
82+
if: needs.changes.outputs.comanda_boundaries_stores == 'true'
83+
uses: ./.github/workflows/template-deployment.yml
8484
with:
85-
service_path: Boundaries/Comanda.Orders
86-
image_name: httpsrichardy/comanda.orders
87-
deploy_url_secret: ORDERS_PRODUCTION_DEPLOY_URL
85+
service_path: Boundaries/Comanda.Stores
86+
image_name: httpsrichardy/comanda.stores
87+
deploy_url_secret: STORES_PRODUCTION_DEPLOY_WEBHOOK_URL
8888
secrets: inherit
8989

90-
deploy-orchestrator:
90+
deploy-comanda-subscriptions:
9191
needs: changes
92-
if: needs.changes.outputs.orchestrator == 'true'
93-
uses: ./.github/workflows/reusable-production-deployment.yml
92+
if: needs.changes.outputs.comanda_boundaries_subscriptions == 'true'
93+
uses: ./.github/workflows/template-deployment.yml
9494
with:
95-
service_path: Boundaries/Comanda.Orchestrator
96-
image_name: httpsrichardy/comanda.orchestrator
97-
deploy_url_secret: ORCHESTRATOR_PRODUCTION_DEPLOY_URL
95+
service_path: Boundaries/Comanda.Subscriptions
96+
image_name: httpsrichardy/comanda.subscriptions
97+
deploy_url_secret: SUBSCRIPTIONS_PRODUCTION_DEPLOY_WEBHOOK_URL
9898
secrets: inherit
Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,53 @@
1-
name: workflow - publish package
1+
name: pipeline ci/cd - publish comanda packages
22

33
on:
44
push:
55
branches:
66
- master
7-
- development
8-
paths:
9-
- 'Artifacts/Comanda.Internal.Contracts/**'
10-
pull_request:
11-
branches:
12-
- master
13-
- development
147
paths:
158
- 'Artifacts/Comanda.Internal.Contracts/**'
9+
- 'Artifacts/Comanda.Internal.AspNet/**'
1610

1711
jobs:
18-
publish:
12+
changes:
1913
runs-on: ubuntu-latest
2014

21-
defaults:
22-
run:
23-
working-directory: Artifacts/Comanda.Internal.Contracts
15+
outputs:
16+
comanda_internal_contracts: ${{ steps.filter.outputs.comanda_internal_contracts }}
17+
comanda_internal_aspnet: ${{ steps.filter.outputs.comanda_internal_aspnet }}
2418

2519
steps:
2620
- name: checkout code
27-
uses: actions/checkout@v4
28-
29-
- name: setup .NET
30-
uses: actions/setup-dotnet@v4
21+
uses: actions/checkout@v5
3122
with:
32-
dotnet-version: '9.0.x'
33-
34-
- name: restore dependencies
35-
run: dotnet restore
23+
fetch-depth: 0
3624

37-
- name: build
38-
run: dotnet build --configuration Release --no-restore
39-
40-
- name: set version and pack
41-
id: pack
42-
run: |
43-
BASE_VERSION="1.0"
44-
45-
if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
46-
VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}"
47-
else
48-
VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}"
49-
fi
50-
51-
echo "use version: $VERSION"
52-
dotnet pack -c Release -p:PackageVersion=$VERSION -o ./output --no-build
53-
54-
echo "package_version=$VERSION" >> $GITHUB_OUTPUT
55-
56-
- name: push package to nuget
57-
run: dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
25+
- name: detect changed paths
26+
id: filter
27+
uses: dorny/paths-filter@v4
28+
with:
29+
filters: |
30+
comanda_internal_contracts:
31+
- 'Artifacts/Comanda.Internal.Contracts/**'
32+
comanda_internal_aspnet:
33+
- 'Artifacts/Comanda.Internal.AspNet/**'
34+
35+
# publish this package if there are changes in the corresponding path
36+
publish-comanda-internal-contracts:
37+
needs: changes
38+
if: needs.changes.outputs.comanda_internal_contracts == 'true'
39+
uses: ./.github/workflows/template-publish-package.yml
40+
with:
41+
working_directory: Artifacts/Comanda.Internal.Contracts/Source
42+
dotnet_version: 9.0.x
43+
secrets: inherit
44+
45+
# publish this package if there are changes in the corresponding path
46+
publish-comanda-internal-aspnet:
47+
needs: changes
48+
if: needs.changes.outputs.comanda_internal_aspnet == 'true'
49+
uses: ./.github/workflows/template-publish-package.yml
50+
with:
51+
working_directory: Artifacts/Comanda.Internal.AspNet/Source
52+
dotnet_version: 9.0.x
53+
secrets: inherit
Lines changed: 77 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,112 @@
1-
name: workflow — trigger pull request quality assurance
1+
name: pipeline ci/cd — trigger pull request quality assurance
22

33
on:
44
pull_request:
5-
branches: [master]
5+
branches:
6+
- master
67

78
jobs:
89
changes:
910
runs-on: ubuntu-latest
1011
outputs:
11-
subscriptions: ${{ steps.filter.outputs.subscriptions }}
12-
stores: ${{ steps.filter.outputs.stores }}
13-
profiles: ${{ steps.filter.outputs.profiles }}
14-
payments: ${{ steps.filter.outputs.payments }}
15-
orders: ${{ steps.filter.outputs.orders }}
16-
orchestrator: ${{ steps.filter.outputs.orchestrator }}
12+
# filters for boundaries
13+
comanda_boundaries_orchestrator: ${{ steps.filter.outputs.comanda_boundaries_orchestrator }}
14+
comanda_boundaries_orders: ${{ steps.filter.outputs.comanda_boundaries_orders }}
15+
comanda_boundaries_payments: ${{ steps.filter.outputs.comanda_boundaries_payments }}
16+
comanda_boundaries_profiles: ${{ steps.filter.outputs.comanda_boundaries_profiles }}
17+
comanda_boundaries_stores: ${{ steps.filter.outputs.comanda_boundaries_stores }}
18+
comanda_boundaries_subscriptions: ${{ steps.filter.outputs.comanda_boundaries_subscriptions }}
19+
20+
# filters for packages
21+
comanda_internal_contracts: ${{ steps.filter.outputs.comanda_internal_contracts }}
22+
comanda_internal_aspnet: ${{ steps.filter.outputs.comanda_internal_aspnet }}
1723

1824
steps:
1925
- name: checkout
20-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2127

2228
- name: detect changed paths
2329
id: filter
24-
uses: dorny/paths-filter@v3
30+
uses: dorny/paths-filter@v4
2531
with:
2632
filters: |
27-
subscriptions:
28-
- 'Boundaries/Comanda.Subscriptions/**'
29-
stores:
30-
- 'Boundaries/Comanda.Stores/**'
31-
profiles:
32-
- 'Boundaries/Comanda.Profiles/**'
33-
payments:
34-
- 'Boundaries/Comanda.Payments/**'
35-
orders:
36-
- 'Boundaries/Comanda.Orders/**'
37-
orchestrator:
33+
comanda_boundaries_orchestrator:
3834
- 'Boundaries/Comanda.Orchestrator/**'
35+
comanda_boundaries_orders:
36+
- 'Boundaries/Comanda.Orders/**'
37+
comanda_boundaries_payments:
38+
- 'Boundaries/Comanda.Payments/**'
39+
comanda_boundaries_profiles:
40+
- 'Boundaries/Comanda.Profiles/**'
41+
comanda_boundaries_stores:
42+
- 'Boundaries/Comanda.Stores/**'
43+
comanda_boundaries_subscriptions:
44+
- 'Boundaries/Comanda.Subscriptions/**'
45+
comanda_internal_contracts:
46+
- 'Artifacts/Comanda.Internal.Contracts/**'
47+
comanda_internal_aspnet:
48+
- 'Artifacts/Comanda.Internal.AspNet/**'
49+
50+
# run build and tests for comanda orchestrator if there are changes in the corresponding path
51+
quality-assurance-boundaries-orchestrator:
52+
needs: changes
53+
if: needs.changes.outputs.comanda_boundaries_orchestrator == 'true'
54+
uses: ./.github/workflows/template-quality-assurance.yml
55+
with:
56+
service_path: Boundaries/Comanda.Orchestrator
57+
58+
# run build and tests for comanda orders if there are changes in the corresponding path
59+
quality-assurance-boundaries-orders:
60+
needs: changes
61+
if: needs.changes.outputs.comanda_boundaries_orders == 'true'
62+
uses: ./.github/workflows/template-quality-assurance.yml
63+
with:
64+
service_path: Boundaries/Comanda.Orders
3965

40-
quality-assurance-subscriptions:
66+
# run build and tests for comanda payments if there are changes in the corresponding path
67+
quality-assurance-boundaries-payments:
4168
needs: changes
42-
if: needs.changes.outputs.subscriptions == 'true'
43-
uses: ./.github/workflows/reusable-quality-assurance.yml
69+
if: needs.changes.outputs.comanda_boundaries_payments == 'true'
70+
uses: ./.github/workflows/template-quality-assurance.yml
4471
with:
45-
service_path: Boundaries/Comanda.Subscriptions
72+
service_path: Boundaries/Comanda.Payments
4673

47-
quality-assurance-stores:
74+
# run build and tests for comanda profiles if there are changes in the corresponding path
75+
quality-assurance-boundaries-profiles:
4876
needs: changes
49-
if: needs.changes.outputs.stores == 'true'
50-
uses: ./.github/workflows/reusable-quality-assurance.yml
77+
if: needs.changes.outputs.comanda_boundaries_profiles == 'true'
78+
uses: ./.github/workflows/template-quality-assurance.yml
5179
with:
52-
service_path: Boundaries/Comanda.Stores
80+
service_path: Boundaries/Comanda.Profiles
5381

54-
quality-assurance-profiles:
82+
# run build and tests for comanda stores if there are changes in the corresponding path
83+
quality-assurance-boundaries-stores:
5584
needs: changes
56-
if: needs.changes.outputs.profiles == 'true'
57-
uses: ./.github/workflows/reusable-quality-assurance.yml
85+
if: needs.changes.outputs.comanda_boundaries_stores == 'true'
86+
uses: ./.github/workflows/template-quality-assurance.yml
5887
with:
59-
service_path: Boundaries/Comanda.Profiles
88+
service_path: Boundaries/Comanda.Stores
6089

61-
quality-assurance-payments:
90+
# run build and tests for comanda subscriptions if there are changes in the corresponding path
91+
quality-assurance-boundaries-subscriptions:
6292
needs: changes
63-
if: needs.changes.outputs.payments == 'true'
64-
uses: ./.github/workflows/reusable-quality-assurance.yml
93+
if: needs.changes.outputs.comanda_boundaries_subscriptions == 'true'
94+
uses: ./.github/workflows/template-quality-assurance.yml
6595
with:
66-
service_path: Boundaries/Comanda.Payments
96+
service_path: Boundaries/Comanda.Subscriptions
6797

68-
quality-assurance-orders:
98+
# run build and tests for comanda internal contracts if there are changes in the corresponding path
99+
quality-assurance-internal-contracts:
69100
needs: changes
70-
if: needs.changes.outputs.orders == 'true'
71-
uses: ./.github/workflows/reusable-quality-assurance.yml
101+
if: needs.changes.outputs.comanda_internal_contracts == 'true'
102+
uses: ./.github/workflows/template-quality-assurance.yml
72103
with:
73-
service_path: Boundaries/Comanda.Orders
104+
service_path: Artifacts/Comanda.Internal.Contracts
74105

75-
quality-assurance-orchestrator:
106+
# run build and tests for comanda internal aspnet if there are changes in the corresponding path
107+
quality-assurance-internal-aspnet:
76108
needs: changes
77-
if: needs.changes.outputs.orchestrator == 'true'
78-
uses: ./.github/workflows/reusable-quality-assurance.yml
109+
if: needs.changes.outputs.comanda_internal_aspnet == 'true'
110+
uses: ./.github/workflows/template-quality-assurance.yml
79111
with:
80-
service_path: Boundaries/Comanda.Orchestrator
112+
service_path: Artifacts/Comanda.Internal.AspNet

0 commit comments

Comments
 (0)