ci: prebuild and push to cache

This commit is contained in:
silver 2024-05-12 16:35:14 +01:00
parent a4482cc618
commit c8a26d63de
Signed by untrusted user: silver
GPG key ID: 54E2C71918E93B74
2 changed files with 38 additions and 0 deletions

View file

@ -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

View file

@ -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;