Skip to content

Commit

Permalink
fix: load .env during images build (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll authored Nov 18, 2024
1 parent 4bc5b15 commit 574fac9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/component_build-images-elastic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Load environment variables from .env file
run: |
if [ -f .env ]; then
# Filter out comments and empty lines, then add each variable to $GITHUB_ENV
grep -vE '^\s*#|^\s*$' .env | while read -r line; do
echo "$line" >> $GITHUB_ENV
done
else
echo ".env file not found!"
exit 1
fi
- name: Check for changes and set push options
id: check_changes
run: |
Expand Down Expand Up @@ -155,6 +166,10 @@ jobs:
file: ${{ matrix.file_tag.file }}
platforms: linux/amd64,linux/arm64
push: ${{ inputs.push }}
build-args: |
OTEL_JAVA_AGENT_VERSION=${{ env.OTEL_JAVA_AGENT_VERSION }}
OPENTELEMETRY_CPP_VERSION=${{ env.OPENTELEMETRY_CPP_VERSION }}
TRACETEST_IMAGE_VERSION=${{ env.TRACETEST_IMAGE_VERSION }}
tags: |
${{ env.GHCR_REPO }}:${{ inputs.version }}-${{ matrix.file_tag.tag_suffix }}
${{ env.GHCR_REPO }}:latest-${{ matrix.file_tag.tag_suffix }}
Expand Down

0 comments on commit 574fac9

Please sign in to comment.