-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (84 loc) · 2.88 KB
/
health-check-dashboard-ci-cd.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
name: Health check dashboard CI CD
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]
jobs:
build-test:
name: Build and test
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Build
run: dotnet build 'src/Admin/HealthCheckDashboard/MedicalSystem.Admin.HealthCheckDashboard.csproj' --configuration Release
analyze:
name: Analyze
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
language: [ 'csharp' ]
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
github-docker-push:
if: ${{ github.event_name == 'push' }}
name: GitHub docker push
runs-on: ubuntu-latest
needs: [build-test, analyze]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Publish
run: dotnet publish 'src/Admin/HealthCheckDashboard/MedicalSystem.Admin.HealthCheckDashboard.csproj' --configuration Release -o 'publish/app'
- name: Docker build
run: docker build -f 'src/Admin/HealthCheckDashboard/Dockerfile' -t docker.pkg.github.com/arnab-developer/medicalsystem/healthcheckdashboard:1.0.2 .
- name: Docker push
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u Arnab-Developer --password-stdin
docker push docker.pkg.github.com/arnab-developer/medicalsystem/healthcheckdashboard:1.0.2
docker logout https://docker.pkg.github.com
dockerhub-push:
if: ${{ github.event_name == 'release' }}
name: Dockerhub push
runs-on: ubuntu-latest
needs: [build-test, analyze]
environment:
name: Dockerhub
url: https://hub.docker.com/r/45862391/webmvc
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: Publish
run: dotnet publish 'src/Admin/HealthCheckDashboard/MedicalSystem.Admin.HealthCheckDashboard.csproj' --configuration Release -o 'publish/app'
- name: Docker build
run: docker build -f 'src/Admin/HealthCheckDashboard/Dockerfile' -t 45862391/healthcheckdashboard:1.0.2 .
- name: Docker push
run: |
echo "${{ secrets.DOCKERHUB_PWD }}" | docker login -u 45862391 --password-stdin
docker push 45862391/healthcheckdashboard:1.0.2
docker logout