Skip to content

Commit 2fcf41b

Browse files
Added step in workflow to check if postgres docker volume exists & create if not.
1 parent 3d56ef8 commit 2fcf41b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ jobs:
102102
# Use 'codebuilder' as the stack prefix
103103
docker compose -p codebuilder up -d --no-deps api
104104
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+
105114
- name: '🗑 Prune Old Docker Images'
106115
if: always()
107116
run: docker image prune -af

0 commit comments

Comments
 (0)