Files
n8n-workflows/.github/workflows/docker.yml
Sahiix@1 3c0a92c460 ssd (#10)
* ok

ok

* Refactor README for better structure and readability

Updated README to improve formatting and clarity.

* Initial plan

* Initial plan

* Initial plan

* Initial plan

* Comprehensive deployment infrastructure implementation

Co-authored-by: sahiixx <221578902+sahiixx@users.noreply.github.com>

* Add comprehensive deployment infrastructure - Docker, K8s, CI/CD, scripts

Co-authored-by: sahiixx <221578902+sahiixx@users.noreply.github.com>

* Add files via upload

* Complete deployment implementation - tested and working production deployment

Co-authored-by: sahiixx <221578902+sahiixx@users.noreply.github.com>

* Revert "Implement comprehensive deployment infrastructure for n8n-workflows documentation system"

* Update docker-compose.prod.yml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/health-check.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: dopeuni444 <sahiixofficial@wgmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-29 09:31:37 +04:00

114 lines
3.0 KiB
YAML

name: Docker Build and Test
on:
push:
branches: [ main, develop ]
paths:
- 'Dockerfile'
- 'docker-compose*.yml'
- 'requirements.txt'
- '*.py'
pull_request:
branches: [ main ]
paths:
- 'Dockerfile'
- 'docker-compose*.yml'
- 'requirements.txt'
- '*.py'
jobs:
docker-build:
name: Build and Test Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
load: true
tags: workflows-doc:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test Docker image
run: |
# Test container starts successfully
docker run --name test-container -d -p 8002:8000 workflows-doc:test
# Wait for container to be ready
sleep 15
# Test health endpoint
curl -f http://localhost:8002/api/stats || exit 1
# Test container logs for errors
docker logs test-container
# Cleanup
docker stop test-container
docker rm test-container
- name: Test Docker Compose
run: |
# Test basic docker-compose
docker compose -f docker-compose.yml up -d --build
# Wait for services
sleep 20
# Test API endpoint
curl -f http://localhost:8000/api/stats || exit 1
# Test with development override
docker compose -f docker-compose.yml -f docker-compose.dev.yml down
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
# Wait for services
sleep 20
# Test development endpoint
curl -f http://localhost:8000/api/stats || exit 1
# Cleanup
docker compose down
- name: Test security scanning
run: |
# Install Trivy
sudo apt-get update
sudo apt-get install wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install trivy
# Scan the built image
trivy image --exit-code 0 --severity HIGH,CRITICAL workflows-doc:test
multi-platform:
name: Test Multi-platform Build
runs-on: ubuntu-latest
needs: docker-build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build multi-platform image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
tags: workflows-doc:multi-platform
cache-from: type=gha
cache-to: type=gha,mode=max