All checks were successful
Staging Blog Deployment / check-hugo-version (push) Successful in 3s
Staging Blog Deployment / build (push) Has been skipped
Staging Blog Deployment / deploy (push) Successful in 8s
Staging Blog Deployment / test (push) Successful in 2s
Staging Blog Deployment / merge (push) Successful in 5s
Staging Blog Deployment / clean (push) Has been skipped
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: Production Blog Deployment
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Staging Blog Deployment"]
|
|
types: [completed]
|
|
branches:
|
|
- 'preview'
|
|
|
|
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
|
|
|