Some checks failed
Build and Push Docker Image / build (push) Failing after 9s
Root cause: act_runner provides minimal environment without sudo or Docker CLI. Cannot install packages in workflow. Solution: Use docker:24-dind container which includes Docker CLI and daemon. Runs with --privileged to allow nested containers. Changes: - Use docker:24-dind as job container - Remove installation steps (Docker pre-installed) - Keep simple login, build, push workflow Also added alternative solution file showing how to configure runner with Docker CLI for better performance. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
37 lines
972 B
YAML
37 lines
972 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: docker:24-dind
|
|
options: --privileged
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login code.puffinoffset.com -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t code.puffinoffset.com/matt/puffin-app:latest \
|
|
-t code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }} \
|
|
.
|
|
|
|
- name: Push Docker images
|
|
run: |
|
|
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
|