Skip to content
/ bits Public

Commit 7568e72

Browse files
committed
Speed up CI container builds
Run bootstrap inside existing bits-ci container to avoid devenv setup overhead. Push full closure to Attic cache so intermediate derivations are available for future builds. Tag images as :latest for subsequent bootstrap runs to pull.
1 parent cf6803c commit 7568e72

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

.forgejo/workflows/bootstrap.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ jobs:
1919
build:
2020
name: Build
2121
runs-on: nixos
22+
container:
23+
image: git.lan.invetica.co.uk/jcf/bits-ci:latest
24+
credentials:
25+
username: jcf
26+
password: ${{ github.token }}
2227

2328
steps:
2429
- uses: actions/checkout@v4
@@ -35,14 +40,23 @@ jobs:
3540
image_path=$(.forgejo/scripts/build.sh bits-ci-amd64 2>&1 | .forgejo/scripts/filter-devenv.sh | head -1)
3641
echo "image_path=$image_path" >> "$GITHUB_OUTPUT"
3742
38-
- name: Push to Attic cache
39-
run: attic push invetica:invetica "${{ steps.build.outputs.image_path }}"
43+
- name: Push closure to Attic cache
44+
run: nix-store -qR "${{ steps.build.outputs.image_path }}" | xargs attic push invetica:invetica
4045

4146
- name: Push to Forgejo
4247
run: |
4348
version="$(date +%Y%m%d)-$(git rev-parse --short HEAD)"
49+
image="git.lan.invetica.co.uk/jcf/bits-ci"
4450
skopeo copy \
4551
"docker-archive:${{ steps.build.outputs.image_path }}" \
46-
"docker://git.lan.invetica.co.uk/jcf/bits-ci:$version" \
52+
"docker://$image:$version" \
4753
--dest-creds="jcf:${{ github.token }}"
48-
echo "Pushed git.lan.invetica.co.uk/jcf/bits-ci:$version"
54+
skopeo copy \
55+
"docker-archive:${{ steps.build.outputs.image_path }}" \
56+
"docker://$image:latest" \
57+
--dest-creds="jcf:${{ github.token }}"
58+
echo ""
59+
echo "✨ Images pushed!"
60+
echo ""
61+
echo "$image:$version"
62+
echo "$image:latest"

0 commit comments

Comments
 (0)