41 lines
1.8 KiB
YAML
41 lines
1.8 KiB
YAML
name: CI image
|
|
|
|
# Builds the Arch image that ci.yml runs in, with the build dependencies preinstalled.
|
|
# Rebuilt weekly to pick up Arch updates.
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: ['.gitea/ci-image/**', '.gitea/workflows/ci-image.yml']
|
|
schedule:
|
|
- cron: '0 3 * * 1'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
image:
|
|
# The build runs on the runner's own Docker daemon, so the amd64 runner has the new
|
|
# image locally right away. It does not re-pull tags it already has.
|
|
runs-on: amd64
|
|
env:
|
|
IMAGE: git.trivk.dev/tri/qtpotato-ci:latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Build
|
|
# No layer cache, so each rebuild picks up the week's Arch updates.
|
|
run: docker build --pull --no-cache -t "$IMAGE" .gitea/ci-image
|
|
- name: Push
|
|
# Gitea's Actions token cannot push to the container registry, so this uses an
|
|
# access token with the write:package scope. Cloudflare rejects request bodies over
|
|
# 100 MB and docker push sends each layer in one request, so regctl pushes the
|
|
# layers in 50 MB chunks instead.
|
|
env:
|
|
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
|
run: |
|
|
curl -fsSL -o /usr/local/bin/regctl \
|
|
https://github.com/regclient/regclient/releases/download/v0.11.7/regctl-linux-amd64
|
|
echo "3737fbbdd791e04e7a831640b681f3397a376498e80e2ad9b1b2d27296f239bc /usr/local/bin/regctl" | sha256sum -c
|
|
chmod +x /usr/local/bin/regctl
|
|
echo "$TOKEN" | regctl registry login git.trivk.dev -u "${{ github.repository_owner }}" --pass-stdin
|
|
regctl registry set git.trivk.dev --blob-chunk 52428800 --blob-max 52428800
|
|
docker save "$IMAGE" -o "$RUNNER_TEMP/image.tar"
|
|
regctl image import "$IMAGE" "$RUNNER_TEMP/image.tar"
|