Switch to Docker-based workflow with CLI commands
Some checks failed
Build and Push Docker Image / build (push) Failing after 4s

Replace Kaniko approach with direct Docker CLI commands.
The Gitea runner mounts Docker socket, making Docker available
in ubuntu-latest environment.

Key changes:
- Remove container specification (Kaniko lacks shell utilities)
- Use docker login with password-stdin for authentication
- Build with docker build using multiple -t tags
- Push both latest and commit SHA tags
- Works with Docker-based Gitea runners

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Matt 2025-10-29 13:53:34 +01:00
parent 8de8fc9b40
commit 6d53650352

View File

@ -8,24 +8,26 @@ on:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: gcr.io/kaniko-project/executor:debug
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Prepare Kaniko config - name: Log in to Gitea Container Registry
run: | run: |
mkdir -p /kaniko/.docker echo "${{ secrets.GITHUB_TOKEN }}" | docker login code.puffinoffset.com -u ${{ github.actor }} --password-stdin
echo "{\"auths\":{\"code.puffinoffset.com\":{\"auth\":\"$(echo -n "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" | base64)\"}}}" > /kaniko/.docker/config.json
- name: Build and push with Kaniko - name: Build Docker image
run: | run: |
/kaniko/executor \ docker build -t code.puffinoffset.com/matt/puffin-app:latest \
--context=${{ github.workspace }} \ -t code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }} \
--dockerfile=${{ github.workspace }}/Dockerfile \ .
--destination=code.puffinoffset.com/matt/puffin-app:latest \
--destination=code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }} \ - name: Push Docker images
--cache=true \ run: |
--cache-repo=code.puffinoffset.com/matt/puffin-app/cache docker push code.puffinoffset.com/matt/puffin-app:latest
docker push code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }}
- name: Show image info
run: |
docker images | grep puffin-app