From e4b2dc61e88cb33b491fe38ac9d70aa1f02b74a9 Mon Sep 17 00:00:00 2001 From: Marc Lichtman Date: Tue, 3 Sep 2024 15:58:43 -0400 Subject: [PATCH] cicd --- .github/workflows/cicd.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index d814f9ee..ef13bf55 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -16,6 +16,12 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Get Most Recent Tag + id: most-recent-tag + uses: "WyriHaximus/github-action-get-previous-tag@v1" - name: Log in with Azure uses: azure/login@v1 @@ -35,25 +41,25 @@ jobs: - name: Run cibuild run: ./scripts/cibuild - - name: Get image tag - id: get_image_tag + - name: Publish Image + id: publish_image run: case "${GITHUB_REF}" in *tags*) echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT ; - echo "acr=pccomponents" >> $GITHUB_OUTPUT + ./scripts/cipublish --acr pccomponents --tag ${{tag}} ;; *) + echo "Publishing to pccomponentstest as latest" ; echo "tag=latest" >> $GITHUB_OUTPUT ; - echo "acr=pccomponentstest" >> $GITHUB_OUTPUT + ./scripts/cipublish --acr pccomponentstest --tag latest ; + echo "Also publishing to pccomponents ACR with unique tag" ; + ./scripts/cipublish --acr pccomponents --tag ${{ steps.most-recent-tag.outputs.tag }}.${{ github.run_number }} ;; esac - - name: Publish images - run: ./scripts/cipublish --acr ${{steps.get_image_tag.outputs.acr}} --tag ${{steps.get_image_tag.outputs.tag}} - outputs: - image_tag: ${{ steps.get_image_tag.outputs.tag }} + image_tag: ${{ steps.publish_image.outputs.tag }} deploy: runs-on: ubuntu-latest