diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b78769a..eb48135 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,10 +7,22 @@ on: branches: [ devel, main ] jobs: - deploy: + environment-check: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' }} - environment: ${{ github.event.workflow_run.head_branch == 'devel' && 'qs' || 'prod' }} + outputs: + env_name: ${{ github.event.workflow_run.head_branch == 'devel' && 'qs' || 'prod' }} + steps: + - name: Determine and print environment + run: | + echo "Determining environment..." + echo "Environment name: ${{ github.event.workflow_run.head_branch == 'devel' && 'qs' || 'prod' }}" + + deploy: + needs: environment-check + runs-on: ubuntu-latest + environment: + name: ${{ needs.environment-check.outputs.env_name }} steps: - uses: actions/checkout@v4 @@ -26,7 +38,7 @@ jobs: uses: shimataro/ssh-key-action@v2 with: key: ${{ secrets.SSH_KEY }} - known_hosts: ${{ vars.KNOWN_HOSTS }} + known_hosts: ${{ secrets.KNOWN_HOSTS }} - name: Deploy to demo server run: | diff --git a/nix/deploy/prod/default.nix b/nix/deploy/prod/default.nix index 51f0565..0ac3906 100644 --- a/nix/deploy/prod/default.nix +++ b/nix/deploy/prod/default.nix @@ -8,7 +8,6 @@ networking.hostName = "archtika-demo"; - /* services.archtika = { enable = true; package = localArchtikaPackage; @@ -22,5 +21,4 @@ maxUserWebsites = 2; }; }; - */ } diff --git a/nix/deploy/prod/hardware-configuration.nix b/nix/deploy/prod/hardware-configuration.nix new file mode 100644 index 0000000..2ded190 --- /dev/null +++ b/nix/deploy/prod/hardware-configuration.nix @@ -0,0 +1,39 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_scsi" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ee176add-b854-4434-94f9-59ba519bbdc1"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/A692-993B"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/d54c93ba-e644-47a9-974d-ed825b88ab8b"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +}