Skip to content

Commit

Permalink
Refactor CI/CD pipeline
Browse files Browse the repository at this point in the history
- Split deployment steps into separate jobs for better organization and clarity
- Added `notify` job to send deployment notifications
- Added `health-check` job to ensure server readiness
- Added `cleanup` job to run cleanup scripts after health check
  • Loading branch information
LeonardoMeireles55 committed Jan 26, 2025
1 parent b5dbb05 commit b31befc
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,33 @@ jobs:
run: |
docker-compose pull
docker-compose up -d
notify:
runs-on: [ self-hosted, linux, x64, backend ]
needs: deploy

steps:
- name: Notify deployment
run: echo "Deployment completed successfully"

health-check:
runs-on: [ self-hosted, linux, x64, backend ]
needs: deploy

steps:
- name: Wait for server to be ready and healthy test
run: |
sleep 15
sleep 20
until curl -sSf http://localhost:${{ secrets.SERVER_LOCAL_PORT }}/actuator/health; do
echo "Waiting for server..."
sleep 5
done
cleanup:
runs-on: [ self-hosted, linux, x64, backend ]
needs: health-check

steps:
- name: Set execute permission for cleanup script
run: chmod +x ./.github/scripts/cleanup_docker.sh
- name: Running scripts
Expand Down

0 comments on commit b31befc

Please sign in to comment.