Skip to content

Commit f8577e8

Browse files
committed
fix
1 parent 92ff592 commit f8577e8

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

.github/workflows/build-and-run.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
- name: Stop all running Docker containers
16+
run: sudo docker stop $(sudo docker ps -aq)
17+
- name: Remove all Docker containers
18+
run: sudo docker rm $(sudo docker ps -aq)
1519
- name: Build the Docker image
1620
run: sudo docker build -t backend .
17-
- name: Stop and remove existing container if it exists
18-
run: |
19-
if [ "$(sudo docker ps -aq -f name=backend)" ]; then
20-
sudo docker stop backend
21-
sudo docker rm backend
22-
fi
2321
- name: Run the Docker container on port 8000
2422
run: sudo docker run -d -p 8000:8000 backend

0 commit comments

Comments
 (0)