From 4346b9b07a0055d5850e7d17f8f62960a97bb247 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Mon, 20 Nov 2023 23:32:04 +0000 Subject: [PATCH] ci: add caching, fix docker image --- .github/workflows/build.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d232145c..e14372d3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,32 +4,23 @@ on: branches: [master] push: branches: [master] - # schedule: - # # 1st and 15th of each month at midnight UTC - # - cron: '0 0 1,15 * *' workflow_dispatch: jobs: - # update_flake_inputs: - # name: Update flake inputs - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - name: Install Nix - # uses: DeterminateSystems/nix-installer-action@v7 - # - name: Update flake inputs - # run: nix flake update - test_nixos_builds: name: Build NixOS configurations runs-on: ubuntu-latest - # needs: [update_flake_inputs] container: - image: nix/nixos:latest + image: nixos/nix:latest env: NIX_EXPERIMENTAL_FEATURES: "nix-command flakes" steps: + - uses: actions/checkout@v4 + - uses: cachix/cachix-action@v12 + with: + name: davsanchez + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Build Darwin VM run: nixos-rebuild build --flake .#nixosConfigurations.darwinVM - name: Build UTM VM @@ -38,10 +29,14 @@ jobs: test_darwin_builds: name: Build Darwin configurations runs-on: macos-latest - # needs: [update_flake_inputs] steps: + - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v7 + - uses: cachix/cachix-action@v12 + with: + name: davsanchez + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Install nix-darwin run: nix run nix-darwin -- switch --flake .# - name: Build Darwin MBP @@ -55,10 +50,14 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} - # needs: [update_flake_inputs] steps: + - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@v7 + - uses: cachix/cachix-action@v12 + with: + name: davsanchez + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - name: Install home-manager run: nix run home-manager/master -- init --switch - name: Build Home Manager david@mbp