mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-10 00:13:02 +01:00
Pass action env variables as script args
This commit is contained in:
parent
5ea13d4bee
commit
454e2e8274
@ -11,4 +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: chmod +x ./rerun-container.sh && ./rerun-container.sh
|
run: chmod +x ./rerun-container.sh && ./rerun-container.sh ${{ env.CONTAINER_NAME }} ${{ env.PORT_PAIR }} ${{ env.NETWORK_NAME }} ${{ env.IMAGE_TAG }}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/sh
|
#!/usr/bin/sh
|
||||||
|
|
||||||
|
CONTAINER_NAME = $1;
|
||||||
|
PORT_PAIR = $2;
|
||||||
|
NETWORK_NAME = $3;
|
||||||
|
IMAGE_TAG = $4;
|
||||||
|
|
||||||
docker stop $CONTAINER_NAME && \
|
docker stop $CONTAINER_NAME && \
|
||||||
docker container rm $(docker ps -aqf "name=$CONTAINER_NAME") && \
|
docker container rm $(docker ps -aqf "name=$CONTAINER_NAME") && \
|
||||||
docker run -d -p $PORT_PAIR --netwok $NETWORK_NAME --name $CONTAINER_NAME $IMAGE_TAG
|
docker run -d -p $PORT_PAIR --netwok $NETWORK_NAME --name $CONTAINER_NAME $IMAGE_TAG
|
||||||
|
Loading…
Reference in New Issue
Block a user