@@ -14,34 +14,16 @@ jobs:
1414 runs-on : ubuntu-latest
1515 permissions :
1616 contents : read
17- packages : write
18- outputs :
19- linux-image : ${{ steps.meta.outputs.tags }}
2017 steps :
21- - name : Set up Docker Buildx
22- uses : docker/setup-buildx-action@v3
23-
24- - name : Login to GitHub Container Registry
25- uses : docker/login-action@v3
18+ - uses : actions/checkout@v4
19+ - uses : nixbuild/nix-quick-install-action@v30
20+ - uses : nix-community/cache-nix-action@v6
2621 with :
27- registry : ${{ env.REGISTRY }}
28- username : ${{ github.actor }}
29- password : ${{ secrets.GITHUB_TOKEN }}
30-
31- - name : Docker meta
32- id : meta
33- uses : docker/metadata-action@v5
34- with :
35- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-linux
36-
37- - name : Build
38- uses : docker/build-push-action@v5
39- with :
40- push : ${{ github.event_name != 'pull_request' }}
41- tags : ${{ steps.meta.outputs.tags }}
42- target : linux-build
43- cache-from : type=gha
44- cache-to : type=gha,mode=max
22+ primary-key : nix-${{ runner.os }}
23+ gc-max-store-size : 1G
24+ purge : true
25+ - name : Nix Build
26+ run : nix build '.#kernel'
4527
4628 build :
4729 runs-on : ubuntu-latest
@@ -53,19 +35,37 @@ jobs:
5335 matrix :
5436 os :
5537 - version : ' 2.15.1.1189'
56- target : qemu -toltec
38+ target : nix -toltec
5739 - version : ' 3.3.2.1666'
58- target : qemu -toltec
40+ target : nix -toltec
5941 - version : ' 3.5.2.1807'
60- target : qemu -toltec
42+ target : nix -toltec
6143 - version : ' 3.8.2.1965'
62- target : qemu -toltec
44+ target : nix -toltec
6345 - version : ' 3.20.0.92'
64- target : qemu -toltec
46+ target : nix -toltec
6547
6648 steps :
6749 - name : Set up Docker Buildx
6850 uses : docker/setup-buildx-action@v3
51+ with :
52+ # Have to use docker as we load an external image.
53+ # Prevents using cache
54+ driver : docker
55+
56+ - uses : actions/checkout@v4
57+ - uses : nixbuild/nix-quick-install-action@v30
58+ - uses : nix-community/cache-nix-action@v6
59+ with :
60+ primary-key : nix-${{ runner.os }}-${{ matrix.os.version }}
61+ restore-prefixes-first-match : nix-${{ runner.os }}-
62+ gc-max-store-size : 2G
63+ purge : true
64+
65+ - name : Nix Build
66+ run : |
67+ nix build '.#"docker-${{ matrix.os.version }}"'
68+ ./result | docker image load
6969
7070 - name : Login to GitHub Container Registry
7171 uses : docker/login-action@v3
@@ -89,10 +89,10 @@ jobs:
8989 push : ${{ github.event_name != 'pull_request' && github.ref_name == 'main' }}
9090 tags : ${{ steps.meta.outputs.tags }}
9191 target : ${{ matrix.os.target }}
92- cache-from : type=gha
93- cache-to : type=gha,mode=max
92+ # cache-from: type=gha
93+ # cache-to: type=gha,mode=max
94+ # linux_image=${{ needs.build-linux.outputs.linux-image }}
9495 build-args : |
9596 fw_version=${{ matrix.os.version }}
96- linux_image=${{ needs.build-linux.outputs.linux-image }}
9797
9898
0 commit comments