Skip to content

Commit 47fd30c

Browse files
Moved volume creation to before container creation.
1 parent 2fcf41b commit 47fd30c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ jobs:
5353
echo '--- DEBUG: Listing node_modules/.bin if exists ---'
5454
if [ -d node_modules/.bin ]; then ls -l node_modules/.bin; else echo "node_modules/.bin does not exist"; fi
5555
56+
# Ensure the Postgres data volume exists before starting services
57+
- name: '🔧 Ensure Postgres data volume exists'
58+
run: |
59+
if [ -z "$(docker volume ls -q -f name=codebuilder-postgres-data)" ]; then
60+
echo "Volume 'codebuilder-postgres-data' not found. Creating it..."
61+
docker volume create codebuilder-postgres-data
62+
else
63+
echo "Volume 'codebuilder-postgres-data' already exists. Skipping creation."
64+
fi
65+
5666
- name: '�🚀 Build, Launch, and Update Services'
5767
run: |
5868
# Step 1: Ensure the Docker network exists.
@@ -102,15 +112,6 @@ jobs:
102112
# Use 'codebuilder' as the stack prefix
103113
docker compose -p codebuilder up -d --no-deps api
104114
105-
- name: '🔧 Ensure Postgres data volume exists'
106-
run: |
107-
if [ -z "$(docker volume ls -q -f name=codebuilder-postgres-data)" ]; then
108-
echo "Volume 'codebuilder-postgres-data' not found. Creating it..."
109-
docker volume create codebuilder-postgres-data
110-
else
111-
echo "Volume 'codebuilder-postgres-data' already exists. Skipping creation."
112-
fi
113-
114115
- name: '🗑 Prune Old Docker Images'
115116
if: always()
116117
run: docker image prune -af

0 commit comments

Comments
 (0)