Skip to content

Homelab – Build Tooling Image #16

Homelab – Build Tooling Image

Homelab – Build Tooling Image #16

# .github/workflows/build-homelab-tooling-image.yml
name: Homelab – Build Tooling Image
on:
workflow_dispatch:
push:
paths:
- ".github/docker/fedora-43-homelab-tooling.Dockerfile"
- ".github/workflows/build-homelab-tooling-image.yml"
schedule:
- cron: "0 6 1 * *"
env:
REGISTRY: ghcr.io
TOOLING_IMAGE_NAME: fedora-43-homelab-tooling
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Normalize repo name to lowercase
id: normalize
run: |
echo "REPO_LOWER=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ steps.normalize.outputs.REPO_LOWER }}/${{ env.TOOLING_IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,format=long
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: .github/docker/fedora-43-homelab-tooling.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}