Compare commits

..

No commits in common. "97b64f459ea5e589c2eb27769332f6f32ae5fa83" and "f11aabab648f83777ca948e7e3e1ee5627299f33" have entirely different histories.

2 changed files with 46 additions and 15 deletions

View file

@ -60,15 +60,46 @@ jobs:
server: ${{ fromJson(needs.parse-flake.outputs.servers) }} server: ${{ fromJson(needs.parse-flake.outputs.servers) }}
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
with: with:
extra_nix_config: experimental-features = nix-command flakes pipe-operators extra_nix_config: experimental-features = nix-command flakes pipe-operators
- name: Check if build can be skipped
id: skip-check
env:
GH_TOKEN: ${{ github.token }}
run: |
last_sha=$(gh api \
"repos/${{ github.repository }}/actions/workflows/ci.yml/runs?branch=main&status=success&per_page=1" \
--jq '.workflow_runs[0].head_sha // empty')
if [[ -z "$last_sha" ]]; then
echo "No previous successful run found, build required"
echo "skip=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Comparing current (${{ github.sha }}) with last successful ($last_sha)"
current_drv=$(nix eval .#nixosConfigurations.${{ matrix.server }}.config.system.build.toplevel.drvPath --raw)
previous_drv=$(nix eval "git+file://$(pwd)?rev=$last_sha#nixosConfigurations.${{ matrix.server }}.config.system.build.toplevel.drvPath" --raw)
if [[ "$current_drv" == "$previous_drv" ]]; then
echo "Derivations match, skipping build"
echo "skip=true" >> "$GITHUB_OUTPUT"
else
echo "Derivations differ, build required"
echo "skip=false" >> "$GITHUB_OUTPUT"
fi
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v15
if: steps.skip-check.outputs.skip != 'true'
with: with:
name: sebastian-stork name: sebastian-stork
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
useDaemon: false useDaemon: false
- name: Build server - name: Build server
if: steps.skip-check.outputs.skip != 'true'
run: nix build .#nixosConfigurations.${{ matrix.server }}.config.system.build.toplevel --print-build-logs run: nix build .#nixosConfigurations.${{ matrix.server }}.config.system.build.toplevel --print-build-logs
deploy: deploy:
needs: [build-check, build-server] needs: [build-check, build-server]

30
flake.lock generated
View file

@ -90,11 +90,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1772596991, "lastModified": 1772424169,
"narHash": "sha256-awJJ4ATy9t8Svrx2z0zAftgXnUaGCFb2Ty0u036CnCQ=", "narHash": "sha256-mhv7yclJj+qCagNv0WOuob5yQNV1aTqKcJLfBMUqsVA=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "cd2d0893966c0a5c27345a9a72d0418b42b7e36d", "rev": "701de032cc247a1c309a34f0ed646e824efd7ac6",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -244,11 +244,11 @@
}, },
"nixpkgs-unstable": { "nixpkgs-unstable": {
"locked": { "locked": {
"lastModified": 1772542754, "lastModified": 1772198003,
"narHash": "sha256-WGV2hy+VIeQsYXpsLjdr4GvHv5eECMISX1zKLTedhdg=", "narHash": "sha256-I45esRSssFtJ8p/gLHUZ1OUaaTaVLluNkABkk6arQwE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8c809a146a140c5c8806f13399592dbcb1bb5dc4", "rev": "dd9b079222d43e1943b6ebd802f04fd959dc8e61",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -260,11 +260,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1772465433, "lastModified": 1772047000,
"narHash": "sha256-ywy9troNEfpgh0Ee+zaV1UTgU8kYBVKtvPSxh6clYGU=", "narHash": "sha256-7DaQVv4R97cii/Qdfy4tmDZMB2xxtyIvNGSwXBBhSmo=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c581273b8d5bdf1c6ce7e0a54da9841e6a763913", "rev": "1267bb4920d0fc06ea916734c11b0bf004bbe17e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -317,11 +317,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772495394, "lastModified": 1772401007,
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=", "narHash": "sha256-YHykQg0h9hrlZGpMcywnaFzQ1Kn/5YNCCOSaaAl6z7Q=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff", "rev": "d8be5ea4cd3bc363492ab5bc6e874ccdc5465fe4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -397,11 +397,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1772592001, "lastModified": 1772419365,
"narHash": "sha256-945zZWaHJ8BfnL+49GzmKSNOY1SmD/XZnra8B2zfFPM=", "narHash": "sha256-+IjvRKrbSQX9/ikWy1ptPJBqG+RildNl7Cd9yypyzU0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-vscode-extensions", "repo": "nix-vscode-extensions",
"rev": "94cfd7508800655275c5b2431ba6ca4788552069", "rev": "96e284c58556366535781d9a476121b2b5e839f1",
"type": "github" "type": "github"
}, },
"original": { "original": {