Skip to content

Commit 0c199a2

Browse files
run each sample locally
1 parent 794bcc0 commit 0c199a2

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/deploy-changed-samples.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,31 @@ jobs:
3030
echo "Identifying changed samples..."
3131
echo $(git diff --name-only HEAD main | grep '^samples/' | awk -F'/' '{print $1"/"$2}' | sort | uniq) > changed_samples.txt
3232
33-
- name: Run Docker Compose Up
33+
- name: Run Docker Compose Up and down
3434
run: |
35-
echo "Running Docker Compose Up..."
36-
docker compose up
35+
echo "DEFANG_DEBUG=$RUNNER_DEBUG" >> $GITHUB_ENV
36+
CHANGED_FILES=$(cat changed_samples.txt)
37+
echo "changed samples"
38+
echo $CHANGED_FILES
3739
38-
- name: Run Docker Compose Down
39-
run: |
40-
echo "Running Docker Compose Down..."
41-
docker compose down
40+
# Iterate over the changed samples and run them one at a time with docker locally
41+
for sample in $CHANGED_FILES; do
42+
(
43+
echo "up $sample"
44+
cd $sample
45+
46+
docker compose up
47+
48+
echo "down $sample"
49+
docker compose down --detach
50+
51+
echo "Started and stopped $sample successfully"
52+
53+
cd ..
54+
) &
55+
done
56+
wait
57+
done
4258
4359
deploy_samples:
4460
runs-on: ubuntu-latest
@@ -83,7 +99,7 @@ jobs:
8399
echo $CHANGED_FILES
84100
85101
# Iterate over the changed samples and deploy them one at a time
86-
for sample in $CHANGED_FILES; do
102+
for sample in $CHANGED_FILES; do
87103
(
88104
echo "Deploying $sample"
89105
cd $sample

0 commit comments

Comments
 (0)