add some readme files #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI-PatientService | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| paths: | |
| - 'Services/PatientService/**' | |
| - 'Services/Common/**' | |
| - 'Services/HL7-dotnetcore/**' | |
| pull_request: | |
| branches: | |
| - "main" | |
| paths: | |
| - 'Services/PatientService/**' | |
| - 'Services/Common/**' | |
| - 'Services/HL7-dotnetcore/**' | |
| workflow_dispatch: | |
| env: | |
| APP: PatientService | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Set up the OpenShift CLI tools required. Note, these used to be included with earlier runner images but that is no longer guaranteed so they must be installed. | |
| - name: Install CLI tools from OpenShift Mirror | |
| uses: redhat-actions/openshift-tools-installer@v1 | |
| with: | |
| source: "mirror" | |
| kam: "latest" | |
| oc: "4" | |
| - 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.3 | |
| 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 |