1 Commits
Author SHA1 Message Date
paul aba2fa9b80 Nix CI tryouts
Build image / build-image (pull_request) Failing after 21s
2025-09-30 17:30:55 +02:00
2 changed files with 7 additions and 49 deletions
+4 -33
View File
@@ -1,40 +1,11 @@
name: Build image
on:
push:
tags:
- 'v*'
pull_request:
jobs:
build-image:
container:
image: node:24-bookworm
env:
USER: node
HOME: /home/node
NIX_CONFIG: experimental-features = nix-command flakes
volumes:
- /var/lib/pbri/docker/nix_runner_nix:/nix
- /var/lib/pbri/docker/nix_runner_etc:/etc/nix
- /var/lib/pbri/docker/nix_runner_home_node:/home/node
options: --user 1000:1000
runs-on: nix
steps:
- name: Prep nix env
run: |
if [ ! -f ~/.nix-profile/etc/profile.d/nix.sh ]; then
curl -L https://nixos.org/nix/install | bash -s -- --no-daemon
fi
. ~/.nix-profile/etc/profile.d/nix.sh
env >> "$GITHUB_ENV"
- name: Checkout repo
uses: actions/checkout@v4
- name: Get image meta
run: nix build .#image-meta -o image-meta
- name: Version check
run: |
VERSION=$(cat image-meta/version)
[ "$GITHUB_REF_NAME" = v"$VERSION" ]
- run: nix build --log-format raw --print-build-logs .#image -o image.tar.gz
- run: gunzip -c image.tar.gz > image.tar
- run: nix run .#crane -- auth login git.pbrinkmeier.de -u paul -p "$PASSWORD"
env:
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
- run: nix run .#crane -- push image.tar $(cat image-meta/name)
- run: ls -lah
- run: nix build .#image -o image.tar.gz
+3 -16
View File
@@ -20,18 +20,11 @@
vendorHash = null;
# For building the package, we use only the files not ignored by Git as inputs.
# Also, flake.nix, flake.lock and .gitea are not included to avoid annoying rebuilds when
# Also, flake.nix and flake.lock are not included to avoid annoying rebuilds when
# working on them.
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = gitignore.lib.gitignoreFilterWith {
basePath = ./.;
extraRules = ''
flake.nix
flake.lock
.gitea
'';
};
src = gitignore.lib.gitignoreSource ./.;
filter = path: type: builtins.baseNameOf path != "flake.nix" && builtins.baseNameOf path != "flake.lock";
};
# Avoid linking against libc
@@ -62,12 +55,6 @@
config.Cmd = [ "${vrnp-static}/bin/vrnp" ];
};
};
apps = {
crane = {
type = "app";
program = "${pkgs.crane}/bin/crane";
};
};
}
);
}