-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (46 loc) · 1.74 KB
/
build-locationservice.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
name: CI-LocationService
on:
push:
branches:
- "main"
paths:
- 'Services/LocationService/**'
- 'Services/Common/**'
- 'Services/HL7-dotnetcore/**'
pull_request:
branches:
- "main"
paths:
- 'Services/LocationService/**'
- 'Services/Common/**'
- 'Services/HL7-dotnetcore/**'
workflow_dispatch:
env:
APP: LocationService
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout source"
uses: actions/checkout@v3
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v2.1.0
- name: Building ${{ env.APP }}
run: |
buildid=$(date +"%Y%m%d").$GITHUB_RUN_ID.$GITHUB_RUN_NUMBER.$GITHUB_RUN_ATTEMPT
echo Starting C# Build as $buildid
dotnet publish $GITHUB_WORKSPACE/Services/$APP/src/$APP.csproj -o $RUNNER_TEMP -c Release
echo Starting Docker Build
imageName=${{ secrets.SILVER_IMAGE_REPOSITORY }}/${{ secrets.SILVER_TOOLS_NAMESPACE }}/$(echo $APP | tr '[:upper:]' '[:lower:]')
docker build -f $GITHUB_WORKSPACE/Services/$APP/src/Dockerfile $RUNNER_TEMP -t $imageName:dev
- name: OpenShift Silver Login
uses: redhat-actions/oc-login@v1.1
with:
openshift_server_url: ${{ secrets.SILVER_URI }}
openshift_token: ${{ secrets.SILVER_TOKEN }}
namespace: ${{ secrets.SILVER_TOOLS_NAMSPACE }}
- name: Pushing ${{ env.APP }} to Silver
run: |
imageName=${{ secrets.SILVER_IMAGE_REPOSITORY }}/${{ secrets.SILVER_TOOLS_NAMESPACE }}/$(echo $APP | tr '[:upper:]' '[:lower:]')
docker login -u ${{ secrets.OPENSHIFT_USER }} -p `oc whoami --show-token` ${{ secrets.SILVER_IMAGE_REPOSITORY }}
docker push $imageName:dev