Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 1m9s
Simplify Docker installation by downloading the static binary directly. This avoids repository/OS version detection issues and ensures we get a recent Docker client with API v1.44+. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
env:
|
|
DOCKER_HOST: tcp://172.16.208.4:2375
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Set up Docker
|
|
run: |
|
|
echo "DOCKER_HOST: ${DOCKER_HOST}"
|
|
# Download Docker static binary for newer API version
|
|
apt-get update -qq && apt-get install -y -qq curl
|
|
curl -fsSL https://download.docker.com/linux/static/stable/x86_64/docker-27.4.1.tgz | tar xz
|
|
mv docker/docker /usr/local/bin/
|
|
rm -rf docker
|
|
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 }}"
|