File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 9494 run : docker push ${{ secrets.DOCKERHUB_USERNAME }}/final_project_react_image:latest
9595
9696 Copy-docker-compose-to-EC2 :
97- needs : test
97+ needs :
98+ [
99+ build-and-push-react-image,
100+ build-and-push-laravel-image,
101+ Copy-docker-compose-to-EC2,
102+ ]
98103 runs-on : ubuntu-latest
99104
100105 steps :
@@ -122,12 +127,7 @@ jobs:
122127
123128 Deploy-Laravel-Docker :
124129 runs-on : ubuntu-latest
125- needs :
126- [
127- build-and-push-react-image,
128- build-and-push-laravel-image,
129- Copy-docker-compose-to-EC2,
130- ]
130+ needs : Copy-docker-compose-to-EC2
131131
132132 steps :
133133 - name : Checkout repository
@@ -178,6 +178,13 @@ jobs:
178178 # Run migrations
179179 docker exec $BACKEND_CONTAINER php artisan migrate --force
180180
181+ # If fails, show error logs
182+ if [ $? -ne 0 ]; then
183+ echo "Migration failed! Showing logs:"
184+ docker logs $BACKEND_CONTAINER | grep -i error
185+ exit 1
186+ fi
187+
181188 # Clean up unused images
182189 docker image prune -a -f
183190
You can’t perform that action at this time.
0 commit comments