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 6c51cda commit f634e9c
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/test-tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Load .env file and set build-args
id: load-env
run: |
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: Load .env file
id: dotenv
uses: xom9ikk/dotenv@v2

- name: Build container
uses: docker/build-push-action@v6
Expand All @@ -50,8 +44,7 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
tags: theredguild/container-sec-tools:latest
build-args: |
$(cat build-args.txt)
build-args: ${{ steps.dotenv.outputs.vars }}

- name: Check disk space
run: df -h

0 comments on commit f634e9c

Please sign in to comment.