on: workflow_dispatch: push: branches: - main env: NIX_CONFIG: | extra-substituters = https://attic.radiantwavetech.com/radiantwave extra-trusted-public-keys = radiantwave:QADrjpBWJssTZ3KmiZtcWEf4uAm66oOlHmtQI3jkrgA= jobs: build-commercial: runs-on: build-server steps: - name: Checkout run: git clone --depth 1 ssh://git@gitea.radiantwavetech.com:2222/RadiantWaveTech/KioskConfig.git . - name: Guard main branch is on the production channel run: | . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh NAME=$(nix eval --impure --raw .#channelName) if [ "$NAME" != "radiantwave" ]; then echo "ERROR: main branch resolves to the '$NAME' channel, expected 'radiantwave'." echo " A dev->main merge brought a dev-pointing channel block into flake.nix." echo " Set channel.appInput/atticRepo/gitRef back to main values before building prod ISOs." exit 1 fi - name: Prepare output directory run: mkdir -p /home/user/radiantwave - name: Build commercial kiosk ISO run: | export NIXPKGS_ALLOW_UNFREE=1 . /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh nix build -L --impure .#nixosConfigurations.commercial-iso.config.system.build.isoImage - name: Rename commercial kiosk ISO run: | ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S) FILENAME="radiantwave-commercial-iso-${ISO_DATE}.iso" cp -L result/iso/*.iso "/home/user/radiantwave/${FILENAME}" echo "COMMERCIAL_ISO_FILENAME=${FILENAME}" >> "$GITHUB_ENV" - name: Copy commercial kiosk ISO to fileserver run: | scp "/home/user/radiantwave/${COMMERCIAL_ISO_FILENAME}" \ radiantwave-infra:/mnt/infrastructure_data/files/images/ - name: Cleanup commercial kiosk ISO run: rm -f "/home/user/radiantwave/${COMMERCIAL_ISO_FILENAME}"