ratemyclient/.forgejo/workflows/docker-build.yml
Kevin Sivic 41e3e11d05
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m6s
Use runner's DOCKER_HOST with default ubuntu container
- Remove custom docker:latest container
- Use default ubuntu-latest (should inherit runner's DOCKER_HOST)
- Install docker.io client in job
- Check DOCKER_HOST environment variable
- Should use runner's tcp://docker-runner:2375 config

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 00:12:38 -05:00

52 lines
1.6 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Set up Docker (use runner's DOCKER_HOST)
run: |
# The runner should have DOCKER_HOST set
echo "DOCKER_HOST from runner: ${DOCKER_HOST:-not set}"
# Install docker client if not present
if ! command -v docker &> /dev/null; then
echo "Installing docker client..."
apt-get update -qq && apt-get install -y -qq docker.io
fi
docker version
- name: Checkout repository
run: |
git clone ${{ github.server_url }}/${{ github.repository }} .
git checkout ${{ github.sha }}
ls -la
- name: Build Docker image
run: |
docker build \
-t forgejo.sivic.me/${{ github.repository }}:latest \
-t forgejo.sivic.me/${{ github.repository }}:${{ github.sha }} \
.
- name: Log in to Forgejo Container Registry
run: |
echo "${{ secrets.GITEA_TOKEN }}" | docker login forgejo.sivic.me -u ${{ github.actor }} --password-stdin
- name: Push Docker images
run: |
docker push forgejo.sivic.me/${{ github.repository }}:latest
docker push forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}
- name: Summary
run: |
echo "✅ Successfully built and pushed:"
echo " - forgejo.sivic.me/${{ github.repository }}:latest"
echo " - forgejo.sivic.me/${{ github.repository }}:${{ github.sha }}"