Skip to content

Commit

Permalink
Move docker args to own prepare step
Browse files Browse the repository at this point in the history
  • Loading branch information
AndesKrrrrrrrrrrr committed Nov 5, 2024
1 parent d4c21a0 commit 30ee3c5
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,17 +561,15 @@ jobs:
driver-opts: |
image=${{vars.AWS_ECR_REPO_BASE}}/moby/buildkit:buildx-stable-1
- name: Building Docker images
continue-on-error: true
id: dockerbuild
- name: Prepare Docker build arguments
id: dockerargs
if: steps.gather.outcome == 'success'
env:
NODE_IMAGE_TAG: ${{ needs.prepare.outputs.NODE_IMAGE_TAG }}
SHA: ${{ github.sha }}
DOCKER_BASE_IMAGE_REGISTRY: ${{ env.DOCKER_BASE_IMAGE_REGISTRY }}
run: |
set -x
echo "Node image tag is: '${NODE_IMAGE_TAG}'"
build_args=(
--build-arg="DOCKER_IMAGE_REGISTRY=${DOCKER_BASE_IMAGE_REGISTRY}"
--build-arg="NODE_IMAGE_TAG=${NODE_IMAGE_TAG}"
Expand All @@ -580,6 +578,21 @@ jobs:
--build-arg="GIT_REPOSITORY_URL=${{ github.repositoryUrl }}"
)
export EXTRA_DOCKER_BUILD_ARGS="${build_args[*]}"
echo "EXTRA_DOCKER_BUILD_ARGS=${EXTRA_DOCKER_BUILD_ARGS}" >> "${GITHUB_ENV}"
- name: Building Docker images
continue-on-error: true
id: dockerbuild
if: steps.gather.outcome == 'success'
env:
NODE_IMAGE_TAG: ${{ needs.prepare.outputs.NODE_IMAGE_TAG }}
SHA: ${{ github.sha }}
DOCKER_BASE_IMAGE_REGISTRY: ${{ env.DOCKER_BASE_IMAGE_REGISTRY }}
run: |
set -x
echo "Node image tag is: '${NODE_IMAGE_TAG}'"
echo "Docker build args are: '${build_args[*]}'"
export EXTRA_DOCKER_BUILD_ARGS
./scripts/ci/run-in-parallel.sh "90_${DOCKER_TYPE}"
- name: Building Docker images Retry
Expand All @@ -591,14 +604,8 @@ jobs:
run: |
set -x
echo "Node image tag is: '${NODE_IMAGE_TAG}'"
build_args=(
--build-arg="DOCKER_IMAGE_REGISTRY=${DOCKER_BASE_IMAGE_REGISTRY}"
--build-arg="NODE_IMAGE_TAG=${NODE_IMAGE_TAG}"
--build-arg="GIT_BRANCH=${GIT_BRANCH}"
--build-arg="GIT_SHA=${SHA}"
--build-arg="GIT_REPOSITORY_URL=${{ github.repositoryUrl }}"
)
export EXTRA_DOCKER_BUILD_ARGS="${build_args[*]}"
echo "Docker build args are: '${build_args[*]}'"
export EXTRA_DOCKER_BUILD_ARGS
./scripts/ci/run-in-parallel.sh "90_${DOCKER_TYPE}"
helm-docker-build:
Expand Down

0 comments on commit 30ee3c5

Please sign in to comment.