Files
nix-ci-container/.gitea/workflows/build.yaml
T
julian 098622c128
Build and Publish Runner Image / build-and-push (push) Failing after 5s
Try changing mtu to allow uploading of the docker container
2026-06-11 20:52:15 +02:00

47 lines
1.5 KiB
YAML

name: Build and Publish Runner Image
on:
push:
branches:
- main
schedule:
# Run at 03:00 every Sunday to keep the base image fresh
- cron: '0 3 * * 0'
env:
# Adjust this if your Gitea domain is different
REGISTRY: gitlab.julian-mutter.de
# This automatically evaluates to your user/repo name (e.g., julian/nix-ci-runner)
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
# We use the standard ubuntu-latest to build our custom runner
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# --- Lower MTU to prevent packet drops on large Nix layers ---
- name: Adjust MTU to fix Docker push timeouts
run: |
# Find the active network interface and lower its MTU
INTERFACE=$(ip route | grep default | awk '{print $5}')
echo "Lowering MTU on interface: $INTERFACE"
sudo ip link set dev $INTERFACE mtu 1400
# Gitea Actions automatically provides a token that can push to its own registry
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.CONTAINER_REGISTRY_GITEA_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_GITEA_PASSWORD }}
- name: Build container image
run: |
docker build . -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- name: Push container image
run: |
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest