82 lines
2.9 KiB
YAML
82 lines
2.9 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
jobs:
|
|
update-and-build:
|
|
runs-on: radiantwave-actions
|
|
|
|
steps:
|
|
# - name: Print Environment
|
|
# run: |
|
|
# echo "=== whoami/hostname ==="
|
|
# whoami
|
|
# hostname
|
|
# echo "=== pwd ==="
|
|
# pwd
|
|
# echo "=== PATH ==="
|
|
# echo "$PATH"
|
|
# echo "=== full env ==="
|
|
# env | sort
|
|
# echo "=== os-release ==="
|
|
# cat /etc/os-release 2>/dev/null || echo "no os-release"
|
|
# echo "=== does /nix exist ==="
|
|
# ls -la /nix 2>&1 || echo "/nix missing"
|
|
# echo "=== does /nix/var/nix/profiles/default/bin exist ==="
|
|
# ls -la /nix/var/nix/profiles/default/bin 2>&1 || echo "missing"
|
|
# echo "=== is this a container ==="
|
|
# cat /proc/1/cgroup 2>/dev/null | head -5
|
|
# [ -f /.dockerenv ] && echo "IS a docker container" || echo "NOT a docker container (no /.dockerenv)"
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
# - name: Install Nix
|
|
# uses: cachix/install-nix-action@v31
|
|
# with:
|
|
# extra_nix_config: |
|
|
# experimental-features = nix-command flakes
|
|
|
|
# - name: Configure git auth for Gitea
|
|
# run: |
|
|
# git config --global url."https://oauth2:${{ secrets.GIT_TOKEN }}@gitea.radiantwavetech.com/".insteadOf "https://gitea.radiantwavetech.com/"
|
|
|
|
- name: Update radiantwave-dev
|
|
run: |
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
nix flake update radiantwave-dev
|
|
|
|
- name: Prepare output directory
|
|
run: mkdir -p /mnt/actions_build_storage/outputs
|
|
|
|
- name: Build dev ISO
|
|
run: |
|
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
nix build -L --impure .#nixosConfigurations.dev-iso.config.system.build.isoImage
|
|
|
|
- name: Rename dev ISO
|
|
run: |
|
|
ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
|
FILENAME="radiantwave-kiosk-iso-dev-${ISO_DATE}.iso"
|
|
cp -L result/iso/*.iso "/mnt/actions_build_storage/outputs/${FILENAME}"
|
|
echo "DEV_ISO_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
|
|
|
- name: Copy dev ISO to fileserver
|
|
run: |
|
|
scp "/mnt/actions_build_storage/outputs/${DEV_ISO_FILENAME}" \
|
|
radiantwave-infra:/mnt/infrastructure_data/files/images/
|
|
|
|
- name: Cleanup dev ISO
|
|
run: rm -f "/mnt/actions_build_storage/outputs/${DEV_ISO_FILENAME}"
|
|
|
|
- name: Commit updated flake.lock
|
|
run: |
|
|
git config user.email "ci@radiantwavetech.com"
|
|
git config user.name "RadiantWave CI"
|
|
git remote set-url origin https://oauth2:${{ secrets.GIT_TOKEN }}@gitea.radiantwavetech.com/RadiantWaveTech/KioskConfig.git
|
|
git add flake.lock
|
|
git commit -m "chore: update radiantwave-dev to latest dev" || echo "Nothing to commit"
|
|
git push
|