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
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:
45
.gitea/workflows/production.yml
Normal file
45
.gitea/workflows/production.yml
Normal 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
|
||||
|
Reference in New Issue
Block a user