Skip to content

Commit

Permalink
updated the docker build to utilize the github event release title an…
Browse files Browse the repository at this point in the history
…d removed the mac build because the arm build covers that.
  • Loading branch information
gzukel committed May 15, 2024
1 parent b63b5dc commit 91972d6
Showing 1 changed file with 4 additions and 62 deletions.
66 changes: 4 additions & 62 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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'
Expand Down

0 comments on commit 91972d6

Please sign in to comment.