Skip to content

Commit 6c0f286

Browse files
committed
added a timeout feature to ensure the container was running before pushing
1 parent d9be750 commit 6c0f286

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/push-docker-image.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ jobs:
3838
- name: Build Docker Image
3939
run: |
4040
docker build -t awesome-fastapi:${{ github.sha }} .
41-
docker run -d -p 8080:8080 awesome-fastapi:${{ github.sha }}
41+
4242
43-
- name: Docker inspect
44-
run: |
45-
docker inspect ghcr.io/${{ env.IMAGE_NAME }}
43+
- name: Wait for Docker container to be ready
44+
run: sleep 30
45+
46+
- name: Confirm Docker container is running
47+
run: docker ps
4648

4749
# Push the Docker image to the registry
4850
- name: Push Docker Image to GHCR

0 commit comments

Comments
 (0)