infrastructure

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

nixos.yaml (902B)


      1 name: "NixOS"
      2 
      3 on:
      4   push:
      5     branches: ["main"]
      6   pull_request:
      7     branches: ["main"]
      8 
      9 jobs:
     10   nixos:
     11     runs-on: native
     12     steps:
     13       - uses: actions/checkout@v4
     14 
     15       - name: Build
     16         run: |
     17           if [[ "$(nix eval .#nixosConfigurations.helios.pkgs.system)" = '"x86_64-linux"' ]]; then
     18             nix build .#nixosConfigurations.helios.config.system.build.toplevel
     19           fi
     20 
     21       - name: Check
     22         run: nix flake check
     23 
     24       - name: Deploy
     25         if: forgejo.ref == 'refs/heads/main'
     26         env:
     27           NIX_SSHOPTS: "-i /var/lib/gitea-runner/default/.ssh/id_ed25519 -o UserKnownHostsFile=/var/lib/gitea-runner/default/.ssh/known_hosts"
     28         run: |
     29           nix run nixpkgs#nixos-rebuild -- --fast --flake .#poseidon --target-host root@188.166.127.72 switch
     30           nix run nixpkgs#nixos-rebuild -- --fast --flake .#helios --target-host root@46.62.150.48 switch