workflow changes chat

This commit is contained in:
2025-09-09 16:00:36 -04:00
parent c0dd5df45d
commit 39073dcb70
4 changed files with 124 additions and 65 deletions
+26 -63
View File
@@ -1,83 +1,46 @@
name: Docker Build & Deploy
name: Docker Build (local only)
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: host
steps:
- name: Checkout code
run: |
echo "Current workspace: $(pwd)"
- name: Checkout
uses: actions/checkout@v4
# Clean workspace first
rm -rf * .git* 2>/dev/null || true
- name: Docker preflight
run: |
command -v docker
docker --version
docker info
# Clone the repository since Gitea runner doesn't auto-checkout
echo "Cloning repository..."
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
echo "Repository cloned successfully"
ls -la
echo "Checking Dockerfile:"
head -30 Dockerfile
- name: Check Docker availability
run: |
echo "Checking Docker installation..."
which docker || (echo "Docker not found in PATH" && exit 1)
docker --version || (echo "Docker not available" && exit 1)
docker info || (echo "Docker daemon not running" && exit 1)
- name: Build Docker image
run: |
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: Login to Gitea registry
run: |
echo "Logging into Gitea container registry..."
# Use a temporary config location to avoid permission issues
export DOCKER_CONFIG=/tmp/docker-config
mkdir -p $DOCKER_CONFIG
echo "${{ secrets.token }}" | docker --config $DOCKER_CONFIG login gitea.skalas.org -u "${{ secrets.username }}" --password-stdin
echo "Login successful, setting up config for push commands..."
- name: Push to Gitea registry
run: |
echo "Pushing to Gitea container registry..."
# Use the same config location for push
export DOCKER_CONFIG=/tmp/docker-config
docker --config $DOCKER_CONFIG push gitea.skalas.org/jskala/nfoguard:latest
docker --config $DOCKER_CONFIG push gitea.skalas.org/jskala/nfoguard:${{ github.sha }}
echo "Images pushed successfully"
# Build and LOAD the image into the host's Docker (no registry)
- name: Build & load locally
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
tags: |
nfoguard:latest
deploy:
needs: build
runs-on: host
if: github.ref == 'refs/heads/main'
runs-on: host
steps:
- name: Deploy application
run: |
echo "Deploying application..."
# Add your deployment commands here
# Examples:
# docker-compose pull
# docker-compose up -d
# or
# docker stop nfoguard || true
# docker run -d --name nfoguard -p 8080:8080 nfoguard:latest
echo "Deployment completed"
- name: (Example) restart local container
run: |
docker rm -f nfoguard || true
docker run -d --name nfoguard \
--restart unless-stopped \
-p 8080:8080 \
nfoguard:latest
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
echo "=== Gitea Registry Diagnostic Script ==="
echo "Checking Gitea container registry configuration..."
# Check if registry endpoint exists
echo "1. Testing registry endpoint..."
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" https://gitea.skalas.org/v2/ || echo "Registry endpoint not reachable"
# Check if packages are enabled in Gitea
echo "2. Testing packages endpoint..."
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" https://gitea.skalas.org/api/packages || echo "Packages endpoint not available"
# Check Docker registry v2 API
echo "3. Testing Docker registry v2 API..."
curl -s https://gitea.skalas.org/v2/_catalog || echo "Registry catalog not available"
# Check if we can reach the specific repository
echo "4. Testing repository endpoint..."
curl -s https://gitea.skalas.org/v2/jskala/nfoguard/tags/list || echo "Repository not available"
# Test authentication
echo "5. Testing authentication..."
echo "Enter your Gitea username:"
read -r username
echo "Enter your Gitea password/token:"
read -rs password
echo "Testing authenticated access..."
curl -s -u "$username:$password" https://gitea.skalas.org/v2/_catalog || echo "Authentication failed"
echo "=== Diagnostic complete ==="
+15
View File
@@ -0,0 +1,15 @@
# Add this to your Gitea app.ini configuration file
# Usually located at /etc/gitea/app.ini or /data/gitea/conf/app.ini
[packages]
ENABLED = true
# Optional: Configure storage
[storage.packages]
STORAGE_TYPE = local
SERVE_DIRECT = false
PATH = /data/packages
# Optional: Set limits
[package]
CHUNKED_UPLOAD_PATH = /tmp/gitea-packages-chunked
+49
View File
@@ -0,0 +1,49 @@
# Gitea Container Registry Configuration Check
## 1. Check Gitea app.ini configuration
Your Gitea `app.ini` should have:
```ini
[packages]
ENABLED = true
[server]
; Make sure these are set correctly
DOMAIN = gitea.skalas.org
ROOT_URL = https://gitea.skalas.org/
```
## 2. Check in Gitea Admin Panel
1. Go to: https://gitea.skalas.org/admin/config
2. Look for "Packages" section
3. Should show "Packages: Enabled"
## 3. Check Repository Package Settings
1. Go to your repo: https://gitea.skalas.org/jskala/NFOguard
2. Check if you see a "Packages" tab
3. Repository settings should allow packages
## 4. Manual Registry Test
Try manually from your runner host:
```bash
# Test login
docker login gitea.skalas.org
# Test push a simple image
docker pull hello-world
docker tag hello-world gitea.skalas.org/jskala/test:latest
docker push gitea.skalas.org/jskala/test:latest
```
## 5. Common Issues
- **Registry not enabled**: Check app.ini [packages] ENABLED = true
- **Wrong URL format**: Should be gitea.skalas.org (not gitea.skalas.org:port)
- **SSL issues**: Make sure HTTPS is properly configured
- **Disk space**: Check if Gitea server has enough space
- **Permissions**: Check file permissions on Gitea data directory