Skip to content

Commit

Permalink
add test docker image to ghcr for dynamic VM testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Oct 10, 2024
1 parent 6cf56b4 commit a58f829
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/build_test_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@ jobs:
- name: Get list of changed Dockerfiles
id: get_changed_files
run: |
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep ansible/docker/test/Dockerfile)
echo "changed_files=$changed_files" >> "$GITHUB_OUTPUT"
if [ ${{ github.event_name }} == "push" ]; then
changed_files=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep ansible/docker/test/Dockerfile)
else
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep ansible/docker/test/Dockerfile)
fi
echo "changed_files=$changed_files" >> "$GITHUB_ENV"
# Generate matrix
- name: Generate matrix
id: generate_matrix
run: |
matrix=$(jq -n --arg files "$changed_files" '{
include: ($files | split("\n") | map(select(length > 0) | {dockerfile: .}))
matrix=$(jq -n --arg files "${changed_files}" '{
"include": ($files | split("\n") | map(select(length > 0) | {dockerfile: .}))
}')
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "matrix<<EOF"$'\n'"$matrix"$'\n'EOF >> $GITHUB_OUTPUT
build-dockerfiles:
name: Build Dockerfiles
Expand Down

0 comments on commit a58f829

Please sign in to comment.