"git@developer.sourcefind.cn:OpenDAS/vision.git" did not exist on "d0de55db37447ff86ba9772fcaf15111a6e969b7"
Unverified Commit 5dd8e04d authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

[Dockerfiles] add: a workflow to check if docker containers can be built in...

[Dockerfiles] add: a workflow to check if docker containers can be built in case of modifications (#7129)

* add: a workflow to check if docker containers can be built if the files are modified.

* type

* unify docker image build test and push

* make it run on prs too.

* check

* check

* check

* check again.

* remove docker test build file.

* remove extra dependencies./

* check
parent 165af7ed
name: Build Docker images (nightly) name: Test, build, and push Docker images
on: on:
pull_request: # During PRs, we just check if the changes Dockerfiles can be successfully built
branches:
- main
paths:
- "docker/**"
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: "0 0 * * *" # every day at midnight - cron: "0 0 * * *" # every day at midnight
concurrency: concurrency:
group: docker-image-builds group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: false cancel-in-progress: true
env: env:
REGISTRY: diffusers REGISTRY: diffusers
CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }} CI_SLACK_CHANNEL: ${{ secrets.CI_DOCKER_CHANNEL }}
jobs: jobs:
build-docker-images: test-build-docker-images:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Check out code
uses: actions/checkout@v3
- name: Find Changed Dockerfiles
id: file_changes
uses: jitterbit/get-changed-files@v1
with:
format: 'space-delimited'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build Changed Docker Images
run: |
CHANGED_FILES="${{ steps.file_changes.outputs.all }}"
for FILE in $CHANGED_FILES; do
if [[ "$FILE" == docker/*Dockerfile ]]; then
DOCKER_PATH="${FILE%/Dockerfile}"
DOCKER_TAG=$(basename "$DOCKER_PATH")
echo "Building Docker image for $DOCKER_TAG"
docker build -t "$DOCKER_TAG" "$DOCKER_PATH"
fi
done
if: steps.file_changes.outputs.all != ''
build-and-push-docker-images:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
permissions: permissions:
contents: read contents: read
packages: write packages: write
......
...@@ -40,6 +40,6 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ ...@@ -40,6 +40,6 @@ RUN python3 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
numpy \ numpy \
scipy \ scipy \
tensorboard \ tensorboard \
transformers transformers matplotlib
CMD ["/bin/bash"] CMD ["/bin/bash"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment