push to registry
This commit is contained in:
@@ -42,18 +42,16 @@ jobs:
|
||||
echo "Building Docker image..."
|
||||
docker build -t nfoguard:latest .
|
||||
docker tag nfoguard:latest nfoguard:${{ github.sha }}
|
||||
docker tag nfoguard:latest gitea.skalas.org/jskala/nfoguard:latest
|
||||
docker tag nfoguard:latest gitea.skalas.org/jskala/nfoguard:${{ github.sha }}
|
||||
echo "Docker image built successfully"
|
||||
|
||||
- name: Push to registry (if main branch)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
- name: Push to Gitea registry
|
||||
run: |
|
||||
echo "Pushing Docker image to registry..."
|
||||
# Add your registry push commands here
|
||||
# Examples:
|
||||
# docker tag nfoguard:latest your-registry.com/nfoguard:latest
|
||||
# docker push your-registry.com/nfoguard:latest
|
||||
# docker push your-registry.com/nfoguard:${{ github.sha }}
|
||||
echo "Image ready for deployment"
|
||||
echo "Pushing to Gitea container registry..."
|
||||
docker push gitea.skalas.org/jskala/nfoguard:latest
|
||||
docker push gitea.skalas.org/jskala/nfoguard:${{ github.sha }}
|
||||
echo "Images pushed successfully"
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# NFOguard - Easy Deployment
|
||||
|
||||
[](https://hub.docker.com/r/jskala/nfoguard)
|
||||
[](https://github.com/jskala/NFOguard/releases)
|
||||
|
||||
Latest Version: v1.0.0
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Download the example files
|
||||
curl -o docker-compose.yml https://raw.githubusercontent.com/jskala/NFOguard-Deploy/main/docker-compose.yml
|
||||
curl -o .env https://raw.githubusercontent.com/jskala/NFOguard-Deploy/main/.env.example
|
||||
|
||||
# Edit your .env file
|
||||
nano .env
|
||||
|
||||
# Start the service
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Available Images
|
||||
|
||||
- **GitHub Container Registry**: `ghcr.io/jskala/nfoguard:latest`
|
||||
- **Docker Hub**: `jskala/nfoguard:latest`
|
||||
|
||||
## Configuration
|
||||
|
||||
See the [.env.example](./.env.example) file for all available configuration options.
|
||||
|
||||
## Docker Compose
|
||||
|
||||
The [docker-compose.yml](./docker-compose.yml) includes:
|
||||
- NFOguard service
|
||||
- PostgreSQL database (optional)
|
||||
- Volume mounts for data persistence
|
||||
- Health checks
|
||||
- Restart policies
|
||||
|
||||
## Updates
|
||||
|
||||
To update to the latest version:
|
||||
|
||||
```bash
|
||||
docker-compose pull
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Source Code
|
||||
|
||||
The source code is available at: https://github.com/jskala/NFOguard
|
||||
@@ -0,0 +1,38 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
nfoguard:
|
||||
image: ghcr.io/jskala/nfoguard:latest
|
||||
container_name: nfoguard
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- PUID=${PUID:-1000}
|
||||
- PGID=${PGID:-1000}
|
||||
- TZ=${TZ:-UTC}
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./config:/app/config
|
||||
- ${MEDIA_PATH}:/media:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Optional: PostgreSQL database
|
||||
# postgres:
|
||||
# image: postgres:15
|
||||
# container_name: nfoguard-db
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# POSTGRES_DB: nfoguard
|
||||
# POSTGRES_USER: ${DB_USER:-nfoguard}
|
||||
# POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||
# volumes:
|
||||
# - postgres_data:/var/lib/postgresql/data
|
||||
|
||||
# volumes:
|
||||
# postgres_data:
|
||||
@@ -0,0 +1,70 @@
|
||||
name: Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
tags: [ 'v*' ]
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: host
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
rm -rf * .git* 2>/dev/null || true
|
||||
git clone https://gitea.skalas.org/jskala/NFOguard.git /tmp/repo
|
||||
cp -r /tmp/repo/* .
|
||||
cp -r /tmp/repo/.* . 2>/dev/null || true
|
||||
rm -rf /tmp/repo
|
||||
|
||||
- name: Set up variables
|
||||
run: |
|
||||
# Get version from tag or use 'latest'
|
||||
if [[ ${{ github.ref }} == refs/tags/* ]]; then
|
||||
VERSION=${GITHUB_REF#refs/tags/}
|
||||
else
|
||||
VERSION=latest
|
||||
fi
|
||||
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||
echo "Building version: $VERSION"
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build -t nfoguard:${{ env.VERSION }} .
|
||||
docker tag nfoguard:${{ env.VERSION }} nfoguard:latest
|
||||
|
||||
- name: Push to GitHub Container Registry
|
||||
run: |
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
docker tag nfoguard:${{ env.VERSION }} ghcr.io/jskala/nfoguard:${{ env.VERSION }}
|
||||
docker tag nfoguard:${{ env.VERSION }} ghcr.io/jskala/nfoguard:latest
|
||||
docker push ghcr.io/jskala/nfoguard:${{ env.VERSION }}
|
||||
docker push ghcr.io/jskala/nfoguard:latest
|
||||
|
||||
- name: Push to Docker Hub
|
||||
run: |
|
||||
echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
||||
docker tag nfoguard:${{ env.VERSION }} jskala/nfoguard:${{ env.VERSION }}
|
||||
docker tag nfoguard:${{ env.VERSION }} jskala/nfoguard:latest
|
||||
docker push jskala/nfoguard:${{ env.VERSION }}
|
||||
docker push jskala/nfoguard:latest
|
||||
|
||||
- name: Update distribution repo
|
||||
run: |
|
||||
# Clone the distribution repo
|
||||
git clone https://github.com/jskala/NFOguard-Deploy.git /tmp/deploy
|
||||
cd /tmp/deploy
|
||||
|
||||
# Update docker-compose.yml with new version
|
||||
sed -i "s|image: .*nfoguard:.*|image: ghcr.io/jskala/nfoguard:${{ env.VERSION }}|" docker-compose.yml
|
||||
|
||||
# Update README with new version info
|
||||
sed -i "s/Latest Version: .*/Latest Version: ${{ env.VERSION }}/" README.md
|
||||
|
||||
# Commit and push changes
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git add .
|
||||
git commit -m "Update to version ${{ env.VERSION }}" || exit 0
|
||||
git push
|
||||
Reference in New Issue
Block a user