Update deploy.yml
Some checks failed
Deploy website to Docker Container / deploy (push) Failing after 31s

This commit is contained in:
TheThomaas 2023-05-26 21:53:47 +02:00
parent 0cff2c5b59
commit 0422c0974a

View file

@ -1,14 +1,10 @@
name: Deploy to Docker Container
name: Deploy website to Docker Container
on:
push:
branches:
- main
env:
CONTAINER_NAME: {{ secret.CONTAINER_NAME }}
CONTAINER_IMAGE: {{ secret.CONTAINER_IMAGE }}
jobs:
deploy:
runs-on: ubuntu-latest
@ -23,12 +19,12 @@ jobs:
npm run production
- name: Build Docker image
run: docker build -t ${CONTAINER_IMAGE} --build-arg SITE_DIRECTORY=dist .
run: docker build -t {{ secret.CONTAINER_IMAGE }} --build-arg SITE_DIRECTORY=dist .
- name: Remove old Docker container
run: |
docker stop ${CONTAINER_NAME} || true && docker rm ${CONTAINER_NAME} || true
docker stop {{ secret.CONTAINER_NAME }} || true && docker rm {{ secret.CONTAINER_NAME }} || true
- name: Run Docker container
run: |
docker run -d -p 8086:3000 --name ${CONTAINER_NAME} ${CONTAINER_IMAGE} --restart unless-stopped
docker run -d -p 8086:3000 --name {{ secret.CONTAINER_NAME }} {{ secret.CONTAINER_IMAGE }} --restart unless-stopped