rework: deployment workflow
All checks were successful
Staging Blog Deployment / check-hugo-version (push) Successful in 3s
Staging Blog Deployment / deploy (push) Successful in 9s
Staging Blog Deployment / test (push) Successful in 3s
Staging Blog Deployment / clean (push) Has been skipped
Staging Blog Deployment / build (push) Has been skipped
Staging Blog Deployment / merge (push) Successful in 5s

This commit is contained in:
2025-06-04 19:40:36 +00:00
parent e835486965
commit 041ed1fe42
3 changed files with 176 additions and 45 deletions

View File

@@ -0,0 +1,45 @@
name: Production Blog Deployment
on:
push:
branches:
- main
env:
CONTAINER_NAME: blog_production
URL: "https://blog.vezpi.com/en/"
jobs:
deploy:
runs-on: docker
container:
volumes:
- /appli/docker/blog:/blog
defaults:
run:
shell: sh
steps:
- name: Restart ${CONTAINER_NAME} container
run: |
cd /blog
docker compose down ${CONTAINER_NAME}
docker compose up -d ${CONTAINER_NAME}
sleep 5
echo "- Displaying container logs"
docker compose logs ${CONTAINER_NAME}
test:
needs: deploy
runs-on: ubuntu
steps:
- name: Check HTTP response
run: |
code=$(curl -s -o /dev/null -w "%{http_code}" "$URL")
echo "HTTP response code: $code"
if [ "$code" -ne 200 ]; then
echo "❌ Service is not healthy (HTTP $code)"
exit 1
else
echo "✅ Service is healthy"
fi