39 lines
1.4 KiB
YAML
39 lines
1.4 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-rpi:
|
|
runs-on: build-server
|
|
|
|
steps:
|
|
- name: Checkout
|
|
run: git clone --depth 1 ssh://git@gitea.radiantwavetech.com:2222/RadiantWaveTech/KioskConfig.git .
|
|
|
|
- name: Prepare output directory
|
|
run: mkdir -p /home/user/radiantwave
|
|
|
|
- name: Build Raspberry Pi image
|
|
run: |
|
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
nix build -L --impure .#nixosConfigurations.radiantwavekiosk-rpi.config.system.build.sdImage
|
|
|
|
- name: Rename Raspberry Pi image
|
|
run: |
|
|
ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
|
FILENAME="radiantwave-rpi-${ISO_DATE}.img.zst"
|
|
cp -L result/sd-image/*.img.zst "/home/user/radiantwave/${FILENAME}"
|
|
echo "RPI_IMAGE_FILENAME=${FILENAME}" >> "$GITHUB_ENV"
|
|
|
|
- name: Move old Raspberry Pi images to archive
|
|
run: |
|
|
ssh nclack@157.245.124.103 'find /mnt/infrastructure_data/files/images -maxdepth 1 -name "radiantwave-rpi*" -exec mv {} /mnt/infrastructure_data/files/images/archives/ ;'
|
|
|
|
- name: Copy Raspberry Pi image to fileserver
|
|
run: |
|
|
scp "/home/user/radiantwave/${RPI_IMAGE_FILENAME}" \
|
|
radiantwave-infra:/mnt/infrastructure_data/files/images/
|
|
|
|
- name: Cleanup Raspberry Pi image
|
|
run: rm -f "/home/user/radiantwave/${RPI_IMAGE_FILENAME}"
|