2025-04-02 16:15:26 +02:00
|
|
|
name: Build images
|
|
|
|
|
|
2025-04-02 15:12:03 +02:00
|
|
|
on:
|
|
|
|
|
push:
|
2025-04-02 16:15:26 +02:00
|
|
|
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
|
2025-04-07 15:39:27 +02:00
|
|
|
jobs:
|
2025-04-09 23:15:22 +02:00
|
|
|
check-docker:
|
2025-04-09 23:50:25 +02:00
|
|
|
runs-on: docker-cli
|
2025-04-09 23:28:59 +02:00
|
|
|
services:
|
|
|
|
|
docker:
|
|
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
|
|
|
|
options: --privileged
|
2025-04-07 15:39:27 +02:00
|
|
|
container:
|
2025-04-09 23:28:59 +02:00
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
2025-04-07 15:39:27 +02:00
|
|
|
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
|
2025-04-02 16:15:26 +02:00
|
|
|
|
2025-04-09 23:15:22 +02:00
|
|
|
build-and-push:
|
2025-04-09 23:50:25 +02:00
|
|
|
runs-on: docker-cli
|
2025-04-10 00:22:09 +02:00
|
|
|
services:
|
|
|
|
|
docker:
|
|
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
|
|
|
|
options: --privileged
|
2025-04-09 23:15:22 +02:00
|
|
|
environment: deploy
|
2025-04-10 00:24:21 +02:00
|
|
|
container:
|
|
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
2025-04-09 23:15:22 +02:00
|
|
|
steps:
|
|
|
|
|
- name: Checkout the repo
|
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
|
|
- name: Login to the registry
|
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
|
with:
|
2025-04-10 00:32:55 +02:00
|
|
|
registry: registry.zeidler.dev
|
2025-04-10 00:36:10 +02:00
|
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
|
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
2025-04-09 23:15:22 +02:00
|
|
|
build:
|
2025-04-09 23:50:25 +02:00
|
|
|
runs-on: docker-cli
|
2025-04-10 00:22:09 +02:00
|
|
|
services:
|
|
|
|
|
docker:
|
|
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
|
|
|
|
options: --privileged
|
2025-04-09 23:15:22 +02:00
|
|
|
environment: deploy
|
2025-04-10 00:24:21 +02:00
|
|
|
container:
|
|
|
|
|
image: registry.zeidler.dev/docker-hub/catthehacker/ubuntu:act-latest
|
2025-04-09 23:15:22 +02:00
|
|
|
steps:
|
|
|
|
|
- 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
|
2025-04-10 00:45:42 +02:00
|
|
|
tags: ${{ env.REGISTRY }}/${{ env.GITHUB_REPOSITORY }}:latest
|