4122e2d128
- Created self-hosted runner workflow for automatic deployment - Deploys on push to main branch - Builds and restarts Docker containers - Includes health check verification 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
37 lines
783 B
YAML
37 lines
783 B
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch: # Allow manual trigger
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: self-hosted
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Pull latest changes
|
|
run: |
|
|
cd /opt/lisilou-portfolio
|
|
git pull origin main
|
|
|
|
- name: Build and restart containers
|
|
run: |
|
|
cd /opt/lisilou-portfolio
|
|
docker compose build
|
|
docker compose up -d
|
|
docker compose ps
|
|
|
|
- name: Clean up old images
|
|
run: |
|
|
docker image prune -f
|
|
|
|
- name: Verify deployment
|
|
run: |
|
|
sleep 5
|
|
curl -f http://localhost:8080/health || echo "Health check failed"
|