diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index a92b0c4d..437d40b7 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -15,16 +15,16 @@ jobs: run: | docker build -t chesco-site:latest -f docker/Dockerfile . - - name: Sync to Host Directory + - name: Deploy Container run: | - # Create the directory if it doesn't exist - mkdir -p ~/chesco + # We use direct docker commands here because they work over the socket + # without needing files to be physically present on the host's disk. - # Copy the compose file to the host directory - cp docker/docker-compose.yaml ~/chesco/docker-compose.yaml - - - name: Deploy with Compose - run: | - # Move into the dedicated directory and restart the service - cd ~/chesco - docker compose up -d --force-recreate + docker stop chesco-site || true + docker rm chesco-site || true + + docker run -d \ + --name chesco-site \ + --restart always \ + -p 8081:80 \ + chesco-site:latest