ci: prebuild and push to cache
This commit is contained in:
parent
a4482cc618
commit
c8a26d63de
2 changed files with 38 additions and 0 deletions
|
@ -2,8 +2,37 @@
|
||||||
|
|
||||||
# only a deploy stage
|
# only a deploy stage
|
||||||
stages:
|
stages:
|
||||||
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
|
.scripts_base: &scripts_base
|
||||||
|
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#bash
|
||||||
|
|
||||||
|
.scripts_cache: &scripts_cache
|
||||||
|
- nix --extra-experimental-features 'nix-command flakes' profile install nixpkgs#attic-client
|
||||||
|
- attic login skynet https://nix-cache.skynet.ie/ $CACHE_KEY
|
||||||
|
- attic use skynet-cache
|
||||||
|
|
||||||
|
build:
|
||||||
|
tags:
|
||||||
|
- nix
|
||||||
|
before_script:
|
||||||
|
- *scripts_base
|
||||||
|
- *scripts_cache
|
||||||
|
stage: build
|
||||||
|
|
||||||
|
# when it runs
|
||||||
|
rules:
|
||||||
|
- if: '$CI_PROJECT_NAMESPACE == "compsoc1/compsoc" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
||||||
|
changes:
|
||||||
|
- src/**/*
|
||||||
|
|
||||||
|
# what it runs
|
||||||
|
script:
|
||||||
|
# cache any dependencies
|
||||||
|
- attic watch-store skynet-cache &
|
||||||
|
- nix --extra-experimental-features 'nix-command flakes' build
|
||||||
|
|
||||||
|
|
||||||
nixos:
|
nixos:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
|
|
|
@ -9,6 +9,15 @@
|
||||||
bfom.url = "gitlab:silver_rust/bfom";
|
bfom.url = "gitlab:silver_rust/bfom";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
sudo nano /etc/nix/nix.conf
|
||||||
|
trusted-users = {username}
|
||||||
|
*/
|
||||||
|
nixConfig = {
|
||||||
|
extra-substituters = "https://nix-cache.skynet.ie/skynet-cache";
|
||||||
|
extra-trusted-public-keys = "skynet-cache:OdfA4Or0JcHiHf05fsiIR4nZT2z2yDEtkoLqhntGAz4=";
|
||||||
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, bfom, ... } @inputs:
|
outputs = { self, nixpkgs, bfom, ... } @inputs:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
|
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
|
||||||
|
|
Loading…
Reference in a new issue