Skip to content

Commit 75f9372

Browse files
committed
fix .env accessibility in build
1 parent ef66d3a commit 75f9372

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

.github/workflows/build-and-push-images.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,21 @@ jobs:
5757
- name: Checkout code
5858
uses: actions/checkout@v4
5959

60+
- name: Load environment variables
61+
run: |
62+
# Load .env file and export variables for build args
63+
set -a
64+
source .env
65+
set +a
66+
67+
# Convert env vars to GitHub Actions format
68+
{
69+
echo "OPENTELEMETRY_CPP_VERSION=$OPENTELEMETRY_CPP_VERSION"
70+
echo "IMAGE_VERSION=$IMAGE_VERSION"
71+
echo "IMAGE_NAME=$IMAGE_NAME"
72+
echo "DEMO_VERSION=$DEMO_VERSION"
73+
} >> $GITHUB_ENV
74+
6075
- name: Set up Depot
6176
uses: depot/setup-action@v1
6277

@@ -76,5 +91,9 @@ jobs:
7691
push: true
7792
tags: |
7893
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DEMO_VERSION }}-${{ matrix.service.name }}
79-
build-args: ${{ matrix.service.build_args }}
94+
build-args: |
95+
OPENTELEMETRY_CPP_VERSION=${{ env.OPENTELEMETRY_CPP_VERSION }}
96+
IMAGE_VERSION=${{ env.IMAGE_VERSION }}
97+
IMAGE_NAME=${{ env.IMAGE_NAME }}
98+
DEMO_VERSION=${{ env.DEMO_VERSION }}
8099
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)