mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-27 15:45:47 +01:00
Pass action-defined vars via env step property
This commit is contained in:
parent
de50d82e15
commit
9b832ea452
@ -11,4 +11,9 @@ jobs:
|
||||
- name: Build Docker image
|
||||
run: docker build -t ${{ vars.IMAGE_TAG }} .
|
||||
- name: Rerun website's Docker container
|
||||
run: chmod +x ./rerun-container.sh && (./rerun-container.sh ${{ vars.CONTAINER_NAME }} ${{ vars.PORT_PAIR }} ${{ vars.NETWORK_NAME }} ${{ vars.IMAGE_TAG }})
|
||||
env:
|
||||
CONTAINER_NAME: ${{ vars.CONATINER_NAME }}
|
||||
NETWORK_NAME: ${{ vars.NETWORK_NAME }}
|
||||
PORT_PAIR: ${{ vars.PORT_PAIR }}
|
||||
IMAGE_TAG: ${{ vars.IMAGE_TAG }}
|
||||
run: chmod +x ./rerun-container.sh && ./rerun-container.sh
|
||||
|
@ -1,10 +1,5 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
CONTAINER_NAME = $1;
|
||||
PORT_PAIR = $2;
|
||||
NETWORK_NAME = $3;
|
||||
IMAGE_TAG = $4;
|
||||
|
||||
docker stop $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
|
||||
|
Loading…
Reference in New Issue
Block a user