Move final step to a separate script

This commit is contained in:
Maciej Pędzich 2024-03-26 19:34:08 +01:00
parent 9cb5c8d37f
commit b82d55d1e1
2 changed files with 3 additions and 3 deletions

View File

@ -11,6 +11,4 @@ jobs:
- name: Build Docker image - name: Build Docker image
run: docker build -t maciejpedzi.ch:latest . run: docker build -t maciejpedzi.ch:latest .
- name: Rerun website's Docker container - name: Rerun website's Docker container
run: docker stop my_website && \ run: rerun-container.sh
docker rm $(docker ps -aqf "ancestor=maciejpedzi.ch:latest") && \
docker run -d -p 8505:80 --name my_website maciejpedzi.ch:latest

2
rerun-container.sh Normal file
View File

@ -0,0 +1,2 @@
docker container rm -f $(docker ps -aqf "ancestor=maciejpedzi.ch:latest")
docker run -d -p 8505:80 --name my_website maciejpedzi.ch:latest