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

Added Docker CI #193

Merged
merged 1 commit into from
Feb 6, 2025
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
56 changes: 56 additions & 0 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Docker
on:
push:
branches: [ develop, release/** ]
paths:
- 'Dockerfiles/**'
- '.github/workflows/**'
pull_request:
branches: [ develop, release/** ]
paths:
- 'Dockerfiles/**'
- '.github/workflows/**'

jobs:
find-dockerfiles:
name: Find Dockerfiles
runs-on: self-hosted
outputs:
files: ${{ steps.find-files.outputs.files }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Find Dockerfiles
id: find-files
run: |
echo "## Finding all Dockerfiles in the 'Dockerfiles/' directory"
FILES=$(find Dockerfiles/ -type f -printf "%f\n" | grep .*Dockerfile)
echo "Found Dockerfiles:"
echo "$FILES"
# Convert the array to JSON array
JSON_ARRAY=$(printf '%s\n' "${FILES[@]}" | jq -R . | jq -s . | jq -c .)
echo "JSON_ARRAY is"
echo $JSON_ARRAY
echo "files=$JSON_ARRAY" >> $GITHUB_OUTPUT
build:
name: Build Docker Images
runs-on: self-hosted
needs: find-dockerfiles
strategy:
matrix:
file: ${{fromJson(needs.find-dockerfiles.outputs.files)}}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image for ${{matrix.file}}
uses: docker/build-push-action@v4
with:
context: Dockerfiles/
file: Dockerfiles/${{matrix.file}}
push: false
tags: rocm-examples/dockerci:latest