Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 60 additions & 43 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
# Git and version control
# Git
.git
.gitignore
.gitattributes

# Python cache and build files
__pycache__
*.pyc
*.pyo
*.pyd
# Documentation (keep README.md for setup.py)
CONTRIBUTING.md
LICENSE
SECURITY.md
INSTALL.md
OPTIMIZATIONS.md

# Development files
.vscode/
.idea/
*.swp
*.swo
*~

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
Expand All @@ -24,6 +38,7 @@ wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
venv/
Expand All @@ -32,14 +47,23 @@ ENV/
.venv/
.env/

# IDE and editor files
# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/
coverage.xml
*.cover
.hypothesis/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
# OS
.DS_Store
.DS_Store?
._*
Expand All @@ -48,45 +72,38 @@ ENV/
ehthumbs.db
Thumbs.db

# Logs and temporary files
# Logs
*.log
*.tmp
*.temp
logs/

# Documentation and examples
docs/
*.md
!README.md
# Cache
cache/
.cache/

# Test files
tests/
test_*
*_test.py
.pytest_cache/
.coverage
htmlcov/
# Reports - keep the directory but exclude generated files
reports/*.json
reports/*.csv
reports/*.html
reports/*.sarif

# Development files
CONTRIBUTING.md
SECURITY.md
LICENSE
setup.py
MANIFEST.in
# Temporary files
tmp/
temp/
*.tmp

# Cache and reports (will be mounted as volumes)
cache/
reports/
*.html
*.json
*.csv
*.sarif
# Docker
Dockerfile*
docker-compose*
.dockerignore

# Environment files
.env
.env.local
.env.production
# CI/CD
.github/
.gitlab-ci.yml
.travis.yml
.circleci/

# Docker files (except Dockerfile)
docker-compose*.yml
.dockerignore
# Local config
.env.local
.env.development.local
.env.test.local
.env.production.local
137 changes: 137 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Build and Publish Docker Image

on:
push:
branches: [ main, develop ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=develop,enable={{is_default_branch}}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run security scan
if: github.event_name != 'pull_request'
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
format: 'sarif'
output: 'trivy-results.sarif'

- name: Upload Trivy scan results to GitHub Security tab
if: github.event_name != 'pull_request'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'

test:
runs-on: ubuntu-latest
needs: build
if: github.event_name != 'pull_request'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Test Docker image
run: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest --help
echo "✅ Docker image test passed!"

publish-release:
runs-on: ubuntu-latest
needs: [build, test]
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
packages: write

steps:
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body: |
## 🚀 EndPointHawk ${{ github.ref_name }}

### Docker Image
```bash
docker pull ghcr.io/${{ github.repository }}:${{ github.ref_name }}
```

### Quick Start
```bash
# Scan a repository
docker run --rm -v $(pwd):/workspace ghcr.io/${{ github.repository }}:${{ github.ref_name }} --repo-path /workspace

# Compare directories
docker run --rm -v /path/to/source:/source -v /path/to/target:/target ghcr.io/${{ github.repository }}:${{ github.ref_name }} --compare-dir /target --repo-path /source
```

### What's New
- Docker image now available on GitHub Container Registry
- Multi-architecture support (AMD64, ARM64)
- Security scanning with Trivy
- Automated releases on version tags
Loading