Update deploy.yml
All checks were successful
Deploy website to Docker Container / deploy (push) Successful in 39s
All checks were successful
Deploy website to Docker Container / deploy (push) Successful in 39s
This commit is contained in:
parent
2010768c0a
commit
7bc00225af
|
|
@ -4,7 +4,9 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
env:
|
||||||
|
CONTAINER_NAME: 11ty-workflow-example
|
||||||
|
CONTAINER_IMAGE: thethomaas/11ty-workflow-example:latest
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -19,16 +21,12 @@ jobs:
|
||||||
npm run production
|
npm run production
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: docker build -t thethomaas/11ty-workflow-example:latest --build-arg SITE_DIRECTORY=dist .
|
run: docker build -t $CONTAINER_IMAGE --build-arg SITE_DIRECTORY=dist .
|
||||||
|
|
||||||
- run: |
|
|
||||||
echo ${{secrets.CONTAINER_NAME}} | sed 's/./& /g'
|
|
||||||
echo ${{secrets.CONTAINER_IMAGE}} | sed 's/./& /g'
|
|
||||||
|
|
||||||
- name: Remove old Docker container
|
- name: Remove old Docker container
|
||||||
run: |
|
run: |
|
||||||
docker stop dev || true && docker rm dev || true
|
docker stop $CONTAINER_NAME || true && docker rm $CONTAINER_NAME || true
|
||||||
|
|
||||||
- name: Run Docker container
|
- name: Run Docker container
|
||||||
run: |
|
run: |
|
||||||
docker run -d -p 8086:3000 --name dev thethomaas/11ty-workflow-example:latest
|
docker run -d -p 8086:3000 --name $CONTAINER_NAME $CONTAINER_IMAGE
|
||||||
Loading…
Reference in a new issue