generated from fullstackhero/dotnet-microservices-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 2.89 KB
/
release.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
name: release
on:
workflow_dispatch:
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
release:
name: Release Generation
environment: 'develop'
permissions:
contents: write
issues: write
pull-requests: write
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 19.x
- name: Install Node dependencies
run: npm ci
- name: Semantic Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
docker:
name: Docker Build & Push
environment: 'develop'
runs-on: ubuntu-latest
needs:
- release
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker Login
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Gateway Image
working-directory: ./
run: dotnet publish projects/fluentpos-lite/src/api-gateway/Gateway/Gateway.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerImageName=${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.gateway
- name: Push Gateway Image
run: docker push ${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.gateway --all-tags
- name: Build Identity Server Image
working-directory: ./
run: dotnet publish projects/fluentpos-lite/src/identity-server/Host/Host.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerImageName=${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.identity
- name: Push Identity Server Image
run: docker push ${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.identity --all-tags
- name: Build Catalog Service Image
working-directory: ./
run: dotnet publish projects/fluentpos-lite/src/services/catalog/Host/Host.csproj --os linux --arch x64 -c Release -p:PublishProfile=DefaultContainer -p:ContainerImageName=${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.catalog
- name: Push Catalog Service Image
run: docker push ${{ secrets.DOCKER_USERNAME }}/fluentpos-lite.catalog --all-tags
cleanup:
name: Cleanup
needs:
- docker
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: "♻️ Removes Build Artifacts"
uses: geekyeggo/delete-artifact@v1
with:
name: |
build
test
release
docker