From 027772f62fa2d7babe37737d8c9b7ae172ae6a70 Mon Sep 17 00:00:00 2001 From: Paul Taladay Date: Fri, 29 Mar 2024 14:02:47 -0700 Subject: [PATCH] Added working path --- .github/actions/docker-add-tag/action.yml | 36 ++++++++++++++++++++++ .github/workflows/fhir-oss-ci-pipeline.yml | 28 ++++++++++++++--- 2 files changed, 59 insertions(+), 5 deletions(-) create mode 100644 .github/actions/docker-add-tag/action.yml diff --git a/.github/actions/docker-add-tag/action.yml b/.github/actions/docker-add-tag/action.yml new file mode 100644 index 0000000000..68d89b1835 --- /dev/null +++ b/.github/actions/docker-add-tag/action.yml @@ -0,0 +1,36 @@ +name: Docker Add Main tag +description: 'Adds the main tag to the images for all supported FHIR versions' + +inputs: + sourceTag: + description: 'The tag to apply to the images' + required: true + targetTag: + description: 'The tag to apply to the images' + required: true + fhirSchemaVersion: + description: 'The FHIR schema version to package' + required: true + azureContainerRegistry: + description: 'The Azure Container Registry to push the images to' + required: true + +runs: + using: 'composite' + steps: + - name: Azure Login + uses: azure/login@v2 + with: + client-id: ${{secrets.AZURE_CLIENT_ID}} + subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}} + tenant-id: ${{secrets.AZURE_TENANT_ID}} + enable-AzPSSession: true + - name: Add Tag to Docker Images + shell: bash + run: | + az acr login -n ${{inputs.azureContainerRegistry}} + sourceImage="${{inputs.azureContainerRegistry}}/${{inputs.fhirSchemaVersion}}_fhir-server:${{inputs.sourceTag}}" + targetImage="${{inputs.azureContainerRegistry}}/${{inputs.fhirSchemaVersion}}_fhir-server:${{inputs.targetTag}}" + docker pull $sourceImage + docker tag $sourceImage $targetImage + docker push $targetImage diff --git a/.github/workflows/fhir-oss-ci-pipeline.yml b/.github/workflows/fhir-oss-ci-pipeline.yml index 73bc5b8473..ca4adcc8dc 100644 --- a/.github/workflows/fhir-oss-ci-pipeline.yml +++ b/.github/workflows/fhir-oss-ci-pipeline.yml @@ -105,11 +105,6 @@ jobs: # chmod +x $RUNNER_TEMP/sbom-tool # $RUNNER_TEMP/sbom-tool generate -b . -bc . -V Verbose -ps "Organization: Microsoft" -pv ${{needs.setup.outputs.majorMinorPatch}} -pn ${{needs.setup.outputs.informationalVersion}} - # - name: Docker Build - # uses: ./.github/actions/docker-build - # with: - # assemblySemFileVer: ${{needs.setup.outputs.semVer}} - - name: Upload a Build Artifact uses: actions/upload-artifact@v4 with: @@ -133,6 +128,7 @@ jobs: 6.x 8.x - name: Nuget Restore + working-directory: ${{github.workspace}}/fhirserver/fhirserver shell: bash run: dotnet restore --verbosity detailed - name: Download Build Artifacts from Job Cache @@ -147,11 +143,33 @@ jobs: outputPath: ${{env.outputPath}} buildConfiguration: ${{env.buildConfiguration}} semVer: ${{needs.setup.outputs.semVer}} + # - name: Docker Build + # uses: ./.github/actions/docker-build + # with: + # assemblySemFileVer: ${{needs.setup.outputs.semVer}} # runIntegrationTests: # runs-on: ubuntu-latest # needs : buildAndUnitTest # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # fetch-depth: 0 # - name: Download Build Artifact for Testing # uses: actions/download-artifact@v4 # with: # path: artifacts + # - name: Install Latest .Net SDK + # uses: actions/setup-dotnet@v4 + # with: + # global-json-file: 'global.json' + # dotnet-version: | + # 6.x + # 8.x + # - name: Docker add main tag + # uses: ./.github/actions/docker-add-main-tag + # with: + # assemblySemFileVer: ${{needs.setup.outputs.semVer}} + # imageTag: ${{env.imageTag}} + # azureContainerRegistryName: ${{env.azureContainerRegistryName}} + # connectedServiceName: ${{env.connectedServiceName}}