Skip to content

Merge pull request #120 from bcgov/hibc_migration_dev #40

Merge pull request #120 from bcgov/hibc_migration_dev

Merge pull request #120 from bcgov/hibc_migration_dev #40

name: CI-ClaimsService
on:
push:
branches:
- "main"
paths:
- 'Services/ClaimService/**'
- 'Services/Common/**'
- 'Services/HL7-dotnetcore/**'
pull_request:
branches:
- "main"
paths:
- 'Services/ClaimService/**'
- 'Services/Common/**'
- 'Services/HL7-dotnetcore/**'
workflow_dispatch:
env:
APP: ClaimService
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