e5f2581237
Build and Push Docker Image / build (push) Failing after 5s
Operator preference: build and push the :latest image to the registry and leave it; no per-build host cleanup (handle orphan images separately).
29 lines
785 B
YAML
29 lines
785 B
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
# Runs on the forgerunner host: bundled Docker CLI + mounted /var/run/docker.sock.
|
|
runs-on: host
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: registry.alwisp.com
|
|
username: ${{ secrets.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
run: |
|
|
# gitea.repository is already "owner/repo" (e.g. jason/breedr).
|
|
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
|
|
docker build -t "${IMAGE}:latest" .
|
|
docker push "${IMAGE}:latest"
|