From 68b6133f285a7d5f33308d252a0c55d47bc7014e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aridane=20Mart=C3=ADn?= Date: Sat, 29 Jun 2024 12:23:48 +0100 Subject: [PATCH] fix: Start Docker service before loading image add interactive load to read .tar files To ensure that the Docker service is running before attempting to load the image, this commit modifies the deployment workflow to start the Docker service using `systemctl` before executing the `docker load` command. This prevents any potential issues with loading the image due to the Docker service not being active. --- .github/workflows/deploy.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8a5d96e..f7de07b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -38,7 +38,8 @@ jobs: username: ${{ secrets.EC2_USER }} key: ${{ secrets.EC2_KEY }} script: | - docker import < ~/gatos-sin-hogar-backend.tar + sudo systemctl status docker || sudo systemctl start docker + docker load -i < ~/gatos-sin-hogar-backend.tar docker stop gatos-sin-hogar-backend || true docker rm gatos-sin-hogar-backend || true docker run -d --name gatos-sin-hogar-backend -p 80:7000 gatos-sin-hogar-backend