Compare commits
No commits in common. "072ee1219735426c957c87a907f2072b73ccfe50" and "7cf2f53793837db607a1cba3e9c1b24915d2576a" have entirely different histories.
072ee12197
...
7cf2f53793
@ -6,35 +6,27 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build-image:
|
build-image:
|
||||||
container:
|
container:
|
||||||
image: node:24-bookworm
|
image: catthehacker/ubuntu:act-latest
|
||||||
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
|
|
||||||
steps:
|
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
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
# Required for installing nix
|
||||||
|
- name: Install sudo
|
||||||
|
run: apt-get update && apt-get install -y sudo
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
with:
|
||||||
|
enable_kvm: false
|
||||||
- name: Get image meta
|
- name: Get image meta
|
||||||
run: nix build .#image-meta -o image-meta
|
run: nix build .#image-meta -o image-meta
|
||||||
- name: Version check
|
- name: Version check
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(cat image-meta/version)
|
VERSION=$(cat image-meta/version)
|
||||||
[ "$GITHUB_REF_NAME" = v"$VERSION" ]
|
[ "$GITHUB_REF_NAME" = v"$VERSION" ]
|
||||||
- run: nix build --log-format raw --print-build-logs .#image -o image.tar.gz
|
- name: Build image
|
||||||
- run: gunzip -c image.tar.gz > image.tar
|
run: nix build .#image -o image.tar.gz
|
||||||
- run: nix run .#crane -- auth login git.pbrinkmeier.de -u paul -p "$PASSWORD"
|
- run: docker login -u paul -p "$PASSWORD" git.pbrinkmeier.de
|
||||||
env:
|
env:
|
||||||
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
|
PASSWORD: "${{ secrets.REGISTRY_PASSWORD }}"
|
||||||
- run: nix run .#crane -- push image.tar $(cat image-meta/name)
|
- run: docker load < image.tar.gz
|
||||||
|
- run: docker image push $(cat image-meta/name)
|
||||||
|
|||||||
19
flake.nix
19
flake.nix
@ -20,18 +20,11 @@
|
|||||||
vendorHash = null;
|
vendorHash = null;
|
||||||
|
|
||||||
# For building the package, we use only the files not ignored by Git as inputs.
|
# 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.
|
# working on them.
|
||||||
src = pkgs.lib.cleanSourceWith {
|
src = pkgs.lib.cleanSourceWith {
|
||||||
src = ./.;
|
src = gitignore.lib.gitignoreSource ./.;
|
||||||
filter = gitignore.lib.gitignoreFilterWith {
|
filter = path: type: builtins.baseNameOf path != "flake.nix" && builtins.baseNameOf path != "flake.lock";
|
||||||
basePath = ./.;
|
|
||||||
extraRules = ''
|
|
||||||
flake.nix
|
|
||||||
flake.lock
|
|
||||||
.gitea
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Avoid linking against libc
|
# Avoid linking against libc
|
||||||
@ -62,12 +55,6 @@
|
|||||||
config.Cmd = [ "${vrnp-static}/bin/vrnp" ];
|
config.Cmd = [ "${vrnp-static}/bin/vrnp" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
apps = {
|
|
||||||
crane = {
|
|
||||||
type = "app";
|
|
||||||
program = "${pkgs.crane}/bin/crane";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user