Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: load .env during images build #123

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading