From 91972d6ac96eb5d5981a740822619c98a881df02 Mon Sep 17 00:00:00 2001 From: Grant Zukel Date: Wed, 15 May 2024 12:30:19 -0600 Subject: [PATCH] updated the docker build to utilize the github event release title and removed the mac build because the arm build covers that. --- .github/workflows/docker-build-and-push.yml | 66 ++------------------- 1 file changed, 4 insertions(+), 62 deletions(-) diff --git a/.github/workflows/docker-build-and-push.yml b/.github/workflows/docker-build-and-push.yml index 76646a5e48..dab7def274 100644 --- a/.github/workflows/docker-build-and-push.yml +++ b/.github/workflows/docker-build-and-push.yml @@ -29,15 +29,10 @@ jobs: with: fetch-depth: 0 - - name: Set Version from the PR title. + - name: Set Version from the release title. if: github.event_name != 'workflow_dispatch' run: | - LATEST_RELEASE=$(curl -s -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/releases/latest) - RELEASE_TITLE=$(echo $LATEST_RELEASE | jq -r .name) - echo "Latest release title: $RELEASE_TITLE" - echo "GITHUB_TAG_MAJOR_VERSION=$RELEASE_TITLE" >> $GITHUB_ENV + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.release.name }}" >> $GITHUB_ENV - name: Set Version for Hotfix Release from Input. if: github.event_name != 'pull_request' @@ -58,54 +53,6 @@ jobs: DOCKER_BUILD_KIT: "0" TAG_LATEST: "true" - docker_build_mac: - runs-on: macos-latest - timeout-minutes: 120 - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set Version from the PR title. - if: github.event_name != 'workflow_dispatch' - run: | - LATEST_RELEASE=$(curl -s -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/releases/latest) - RELEASE_TITLE=$(echo $LATEST_RELEASE | jq -r .name) - echo "Latest release title: $RELEASE_TITLE" - echo "GITHUB_TAG_MAJOR_VERSION=$RELEASE_TITLE" >> $GITHUB_ENV - - - name: Set Version for Hotfix Release from Input. - if: github.event_name != 'pull_request' - run: | - echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.inputs.version }}" >> ${GITHUB_ENV} - - - name: Setup docker and docker-compose (missing on MacOS) - if: runner.os == 'macos' - run: | - brew install docker docker-compose - - # Link the Docker Compose v2 plugin so it's understood by the docker CLI - mkdir -p ~/.docker/cli-plugins - ln -sfn /usr/local/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose - - colima start - - - name: "BUILD:PUSH:MONITORING:DOCKER:IMAGE" - uses: ./.github/actions/build-docker-images-generic - with: - DOCKER_FILENAME: "Dockerfile" - REPOSITORY_NAME: "${{ env.DOCKER_REPO }}" - IMAGE_TAG: "mac-${{ env.GITHUB_TAG_MAJOR_VERSION }}" - REGISTRY: "${{ env.DOCKER_REGISTRY }}" - DOCKER_ORG: "${{ env.DOCKER_ORG }}" - USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}" - TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" - DOCKER_FILE_DIRECTORY: "./" - DOCKER_BUILD_KIT: "0" - TAG_LATEST: "false" - docker_build_arm: runs-on: buildjet-4vcpu-ubuntu-2204-arm timeout-minutes: 30 @@ -114,15 +61,10 @@ jobs: with: fetch-depth: 0 - - name: Set Version from the PR title. + - name: Set Version from the release title. if: github.event_name != 'workflow_dispatch' run: | - LATEST_RELEASE=$(curl -s -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - https://api.github.com/repos/${{ github.repository }}/releases/latest) - RELEASE_TITLE=$(echo $LATEST_RELEASE | jq -r .name) - echo "Latest release title: $RELEASE_TITLE" - echo "GITHUB_TAG_MAJOR_VERSION=$RELEASE_TITLE" >> $GITHUB_ENV + echo "GITHUB_TAG_MAJOR_VERSION=${{ github.event.release.name }}" >> $GITHUB_ENV - name: Set Version for Hotfix Release from Input. if: github.event_name != 'pull_request'