From 2e47ff9b7ccd3a6011f67674b8cf0f0aab1f0cca Mon Sep 17 00:00:00 2001 From: Michael Schiemer Date: Thu, 17 Jul 2025 22:10:10 +0200 Subject: [PATCH] chore: update ci-cd.yml --- .gitea/workflows/ci-cd.yml | 86 +++++++------------------------------- 1 file changed, 15 insertions(+), 71 deletions(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 0e5e5af7..56fc20ba 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -1,85 +1,29 @@ -name: CI/CD Pipeline für michaelschiemer.de +name: Minimal Test on: push: branches: [ main, develop ] - pull_request: - branches: [ main ] - -env: - REGISTRY_URL: docker-registry:5000 - IMAGE_NAME: michaelschiemer jobs: test: runs-on: ubuntu-latest steps: + - name: Basic Test + run: | + echo "✅ Workflow is running!" + echo "Container environment:" + uname -a + echo "Available commands:" + which docker || echo "Docker not available" + which git || echo "Git not available" + echo "Network test:" + curl --connect-timeout 5 http://gitea:3000 || echo "Cannot reach gitea" + - name: Checkout Code uses: actions/checkout@v4 - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: gd, zip, pdo, pdo_mysql, opcache, pcntl, posix, shmop, redis - tools: composer - - - name: Install Dependencies - run: composer install --no-progress --prefer-dist --optimize-autoloader - - - name: Build Frontend Assets - run: npm install && npm run build - - # Basic test without external services for now - - name: Run PHP CS Fixer (Check) - run: composer cs || echo "CS check completed" - - build: - needs: test - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' - - steps: - - name: Checkout Code - uses: actions/checkout@v4 - - - name: Login to Private Registry + - name: Success run: | - echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY_URL }} -u admin --password-stdin - - - name: Determine Image Tag - id: tag - run: | - if [ "${{ github.ref }}" = "refs/heads/main" ]; then - echo "tag=latest" >> $GITHUB_OUTPUT - else - echo "tag=develop" >> $GITHUB_OUTPUT - fi - - - name: Build Test Image - run: | - # Create a simple test Dockerfile if none exists - if [ ! -f docker/php/Dockerfile ]; then - mkdir -p docker/php - cat > docker/php/Dockerfile << 'EOF' - FROM php:8.4-fpm - WORKDIR /var/www - COPY . . - RUN echo "Test image built successfully" - EOF - fi - - # Build and push test image - docker build -t ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}/test:${{ steps.tag.outputs.tag }} -f docker/php/Dockerfile . - docker push ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}/test:${{ steps.tag.outputs.tag }} - - - name: Verify Registry Push - run: | - echo "✅ Successfully built and pushed image to registry" - echo "Image: ${{ env.REGISTRY_URL }}/${{ env.IMAGE_NAME }}/test:${{ steps.tag.outputs.tag }}" + echo "🎉 Checkout successful!" + ls -la