Update .gitea/workflows/dockerbuild.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 11s

This commit is contained in:
2025-11-12 21:33:15 +00:00
parent f98429b4f2
commit 5d1c2a266b

View File

@@ -1,60 +1,37 @@
name: Debug and Fix Docker Permissions
name: Build and Push Docker Image
on:
push:
branches: [ main ]
jobs:
debug:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Debug Initial State
- name: Add User to Docker Group and Refresh
run: |
echo "=== Initial Debug ==="
whoami
id
groups
ls -la /var/run/docker.sock
sudo systemctl status docker
- name: Setup Docker
run: |
echo "=== Setting up Docker ==="
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group
sudo usermod -aG docker ${{ github.actor }}
# Fix socket permissions
if [ -S /var/run/docker.sock ]; then
sudo chmod 666 /var/run/docker.sock
fi
echo "=== After Setup ==="
groups
ls -la /var/run/docker.sock
- name: Test Docker Access
run: |
echo "=== Testing Docker Access ==="
# This should work now
docker --version
echo "Current user groups: $(groups)"
# Refresh the group membership for the current shell
newgrp docker << 'EOF'
echo "Testing with new group membership..."
docker info
EOF
# Test with sudo as fallback
sudo docker info
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: git.phyllo.me
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Test with hello-world
sudo docker run --rm hello-world
- name: Final Verification
run: |
echo "=== Final Verification ==="
echo "User: $USER"
echo "Groups: $(groups)"
echo "Docker version: $(docker --version)"
echo "Docker info (should work):"
docker info | head -5
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-${{ github.sha }}
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-latest
build-args: |
BUILD_IDENTIFIER=${{ github.sha }}