ci: push the CI image in chunks under Cloudflare's upload limit
CI / build (pull_request) Successful in 26s
CI / build (pull_request) Successful in 26s
This commit is contained in:
1 parent
57b945b308
commit
917c830be5
1 file changed
+13
-4
@@ -20,12 +20,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker build --pull -t "$IMAGE" .gitea/ci-image
|
# 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
|
- name: Push
|
||||||
# Gitea's Actions token cannot push to the container registry, so this uses an
|
# Gitea's Actions token cannot push to the container registry, so this uses an
|
||||||
# access token with the write:package scope.
|
# 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:
|
env:
|
||||||
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
echo "$TOKEN" | docker login git.trivk.dev -u "${{ github.repository_owner }}" --password-stdin
|
curl -fsSL -o /usr/local/bin/regctl \
|
||||||
docker push "$IMAGE"
|
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"
|
||||||
Reference in new issue
Block a user