Skip to content

Commit

Permalink
ci: use the build args from the dotenv file
Browse files Browse the repository at this point in the history
  • Loading branch information
reynico committed Oct 18, 2024
1 parent f0ddccd commit 6c51cda
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ jobs:
- name: Load .env file and set build-args
id: load-env
run: |
build_args=$(awk -F= '{print "--build-arg", $1"="$2}' .env | tr '\n' ' ')
echo "build_args=$build_args" >> $GITHUB_ENV
build_args=""
while read -r line; do
key=$(echo "$line" | cut -d '=' -f 1)
value=$(echo "$line" | cut -d '=' -f 2)
echo "$key=$value" >> build-args.txt
done < .env
- name: Build container
uses: docker/build-push-action@v6
Expand All @@ -46,7 +50,8 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
tags: theredguild/container-sec-tools:latest
build-args: ${{ env.build_args }}
build-args: |
$(cat build-args.txt)
- name: Check disk space
run: df -h

0 comments on commit 6c51cda

Please sign in to comment.