docker-swiss-army-knife/.forgejo/workflows/publish.yaml
Julius Zeidler 6996b0e324
Some checks failed
Build images / check-docker (push) Successful in 2s
Build images / build-and-push (push) Failing after 26s
test
2025-04-10 00:54:04 +02:00

68 lines
2 KiB
YAML

name: Build images
on:
push:
branches:
- main
# Uncomment to run only when specific files change
# paths:
# - '**/ansible-navigator.yaml'
# - '**/execution-environment.yml'
env:
# Set this to the public IP or hostname of your registry,
# whichever you use to reach it from your desktop/laptop
FORGEJO_HOST: code.zeidler.dev
jobs:
check-docker:
runs-on: docker-cli
services:
docker:
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
options: --privileged
container:
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
steps:
- name: Wait for Docker daemon
run: |
timeout=300 # Set a timeout value in seconds
until docker info; do
echo "Waiting for Docker daemon to start..."
sleep 5
timeout=$((timeout-5))
if [ $timeout -le 0 ]; then
echo "Timeout waiting for Docker daemon to start."
exit 1
fi
done
build-and-push:
runs-on: docker-cli
services:
docker:
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
options: --privileged
environment: deploy
container:
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v4
- name: Login to the registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY_URL }}
username: ${{ vars.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: Build and push
uses: docker/build-push-action@v6
with:
context: context
push: true
provenance: false
platforms: linux/amd64, linux/arm64
tags: ${{ vars.REGISTRY_URL }}/${{ env.GITHUB_REPOSITORY }}:latest