workflow changes chat
This commit is contained in:
+26
-63
@@ -1,83 +1,46 @@
|
|||||||
name: Docker Build & Deploy
|
name: Docker Build (local only)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, develop ]
|
branches: [ main, develop ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: host
|
runs-on: host
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout
|
||||||
run: |
|
uses: actions/checkout@v4
|
||||||
echo "Current workspace: $(pwd)"
|
|
||||||
|
|
||||||
# Clean workspace first
|
- name: Docker preflight
|
||||||
rm -rf * .git* 2>/dev/null || true
|
run: |
|
||||||
|
command -v docker
|
||||||
|
docker --version
|
||||||
|
docker info
|
||||||
|
|
||||||
# Clone the repository since Gitea runner doesn't auto-checkout
|
# Build and LOAD the image into the host's Docker (no registry)
|
||||||
echo "Cloning repository..."
|
- name: Build & load locally
|
||||||
git clone https://gitea.skalas.org/jskala/NFOguard.git /tmp/repo
|
uses: docker/build-push-action@v6
|
||||||
cp -r /tmp/repo/* .
|
with:
|
||||||
cp -r /tmp/repo/.* . 2>/dev/null || true
|
context: .
|
||||||
rm -rf /tmp/repo
|
push: false
|
||||||
|
load: true
|
||||||
echo "Repository cloned successfully"
|
tags: |
|
||||||
ls -la
|
nfoguard:latest
|
||||||
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"
|
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: host
|
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
|
runs-on: host
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy application
|
- name: (Example) restart local container
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying application..."
|
docker rm -f nfoguard || true
|
||||||
# Add your deployment commands here
|
docker run -d --name nfoguard \
|
||||||
# Examples:
|
--restart unless-stopped \
|
||||||
# docker-compose pull
|
-p 8080:8080 \
|
||||||
# docker-compose up -d
|
nfoguard:latest
|
||||||
# or
|
|
||||||
# docker stop nfoguard || true
|
|
||||||
# docker run -d --name nfoguard -p 8080:8080 nfoguard:latest
|
|
||||||
echo "Deployment completed"
|
|
||||||
|
|||||||
@@ -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 ==="
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user