Update CI workflow to use new container naming and registry path
Some checks failed
CI/CD / test-backend (pull_request) Successful in 9s
CI/CD / test-frontend (pull_request) Successful in 10s
CI/CD / build-and-deploy (pull_request) Failing after 17s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
Some checks failed
CI/CD / test-backend (pull_request) Successful in 9s
CI/CD / test-frontend (pull_request) Successful in 10s
CI/CD / build-and-deploy (pull_request) Failing after 17s
CI/CD Pipeline / Overall Status ✅ Все проверки прошли успешно
CI/CD / pr-status (pull_request) Successful in 1s
- Changed container name from 'fastapi-container' to 'fastapi-test-container' for clarity. - Updated image tag to reference the new registry path 'git.rlkdev.ru/RLK/fastapi-app:latest'. - Adjusted logs check to reflect the new container name for successful application startup detection.
This commit is contained in:
@@ -93,22 +93,22 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: false
|
push: false
|
||||||
load: true
|
load: true
|
||||||
tags: fastapi-app:latest
|
tags: git.rlkdev.ru/RLK/fastapi-app:latest
|
||||||
cache-from: type=local,src=/tmp/.buildx-cache
|
cache-from: type=local,src=/tmp/.buildx-cache
|
||||||
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
||||||
|
|
||||||
- name: Stop and remove old container
|
- name: Stop and remove old container
|
||||||
run: |
|
run: |
|
||||||
docker stop fastapi-container || true
|
docker stop fastapi-test-container || true
|
||||||
docker rm fastapi-container || true
|
docker rm fastapi-test-container || true
|
||||||
|
|
||||||
- name: Run new container
|
- name: Run new container
|
||||||
run: |
|
run: |
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name fastapi-container \
|
--name fastapi-test-container \
|
||||||
-p 8080:8000 \
|
-p 8080:8000 \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
fastapi-app:latest
|
git.rlkdev.ru/RLK/fastapi-app:latest
|
||||||
|
|
||||||
- name: Wait for container to be ready
|
- name: Wait for container to be ready
|
||||||
run: |
|
run: |
|
||||||
@@ -116,7 +116,7 @@ jobs:
|
|||||||
interval=2
|
interval=2
|
||||||
elapsed=0
|
elapsed=0
|
||||||
while [ $elapsed -lt $timeout ]; do
|
while [ $elapsed -lt $timeout ]; do
|
||||||
if docker logs fastapi-container 2>&1 | grep -q "Application startup complete"; then
|
if docker logs fastapi-test-container 2>&1 | grep -q "Application startup complete"; then
|
||||||
echo "Application startup detected in logs"
|
echo "Application startup detected in logs"
|
||||||
echo "Deployment successful!"
|
echo "Deployment successful!"
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user