37 lines
815 B
YAML
37 lines
815 B
YAML
name: Docker Build and Deploy
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out repository code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create dockerignore dynamically
|
|
run: |
|
|
cat << 'EOF' > .dockerignore
|
|
node_modules
|
|
dist
|
|
.git
|
|
EOF
|
|
|
|
- name: Build Docker Image
|
|
run: |
|
|
docker build --no-cache -t housekeeping-web:latest .
|
|
|
|
- name: Reštart kontajnera v Portaineri
|
|
run: |
|
|
docker stop housekeeping_web || true
|
|
docker rm housekeeping_web || true
|
|
|
|
docker run -d \
|
|
--name housekeeping_web \
|
|
--restart always \
|
|
-p 8085:80 \
|
|
housekeeping-web:latest |