Skip to content

Commit 794bcc0

Browse files
run compose up in a container with docker installed
1 parent 6226098 commit 794bcc0

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

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

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
run_samples_locally:
1010
runs-on: ubuntu-latest
11+
container:
12+
image: docker:27-cli
1113
permissions:
1214
contents: read
1315
id-token: write
@@ -31,12 +33,12 @@ jobs:
3133
- name: Run Docker Compose Up
3234
run: |
3335
echo "Running Docker Compose Up..."
34-
docker-compose up
36+
docker compose up
3537
3638
- name: Run Docker Compose Down
3739
run: |
3840
echo "Running Docker Compose Down..."
39-
docker-compose down
41+
docker compose down
4042
4143
deploy_samples:
4244
runs-on: ubuntu-latest
@@ -81,15 +83,22 @@ jobs:
8183
echo $CHANGED_FILES
8284
8385
# Iterate over the changed samples and deploy them one at a time
84-
for sample in $CHANGED_FILES; do
85-
echo "Deploying $sample"
86-
cd $sample
86+
for sample in $CHANGED_FILES; do
87+
(
88+
echo "Deploying $sample"
89+
cd $sample
8790
88-
# deploy the sample
89-
defang compose up
91+
# deploy the sample
92+
defang compose up
9093
91-
# teardown the sample
92-
defang compose down --detach
94+
echo "Deprovisioning $sample"
95+
# teardown the sample
96+
defang compose down --detach
9397
94-
cd ..
98+
echo "Deployed and deprovisioned $sample successfully"
99+
100+
cd ..
101+
) &
102+
done
103+
wait
95104
done

0 commit comments

Comments
 (0)