- Add GitHub Actions CI/CD pipeline - Configure Nginx reverse proxy for robeing services - Setup docker-compose for full stack deployment - Include health checks for all services - Support for PostgreSQL and Redis data persistence 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Deploy Nginx
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and push Nginx
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./nginx
|
|
push: true
|
|
tags: |
|
|
${{ secrets.DOCKER_USERNAME }}/robeing-nginx:latest
|
|
${{ secrets.DOCKER_USERNAME }}/robeing-nginx:${{ github.sha }}
|
|
|
|
- name: Update docker-compose.yml
|
|
run: |
|
|
sed -i "s|image: .*/robeing-nginx:.*|image: ${{ secrets.DOCKER_USERNAME }}/robeing-nginx:${{ github.sha }}|g" docker-compose.yml
|
|
|
|
- name: Commit and push changes
|
|
run: |
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git add docker-compose.yml
|
|
git commit -m "Update nginx image to ${{ github.sha }}" || exit 0
|
|
git push |