80 lines
2.9 KiB
YAML
80 lines
2.9 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
update-and-build:
|
|
runs-on: radiantwave-actions
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- 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
|
|
run: |
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
nix flake update radiantwave
|
|
|
|
- name: Build ISO and image artifacts
|
|
run: |
|
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
|
|
mkdir -p /home/runner/radiantwave
|
|
|
|
ISO_DATE=$(date +%Y-%m-%d_%H-%M-%S)
|
|
|
|
nix build -L --impure .#nixosConfigurations.usb-iso.config.system.build.isoImage
|
|
cp -L result/iso/*.iso \
|
|
"/home/runner/radiantwave/radiantwave-kiosk-iso-${ISO_DATE}.iso"
|
|
|
|
nix build -L --impure .#nixosConfigurations.android-iso.config.system.build.isoImage
|
|
cp -L result/iso/*.iso \
|
|
"/home/runner/radiantwave/radiantwave-kiosk-android-iso-${ISO_DATE}.iso"
|
|
|
|
nix build -L --impure .#nixosConfigurations.commercial-usb-iso.config.system.build.isoImage
|
|
cp -L result/iso/*.iso \
|
|
"/home/runner/radiantwave/radiantwave-kiosk-commercial-iso-${ISO_DATE}.iso"
|
|
|
|
nix build -L --impure .#nixosConfigurations.radiantwavekiosk-rpi.config.system.build.sdImage
|
|
cp -L result/sd-image/*.img.zst \
|
|
"/home/runner/radiantwave/radiantwave-kiosk-rpi-${ISO_DATE}.img.zst"
|
|
|
|
- name: Copy outputs to fileserver
|
|
run: |
|
|
scp /home/runner/radiantwave/* \
|
|
nclack@157.245.124.103:/mnt/infrastructure_data/files/images/
|
|
|
|
- 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 to latest main" || echo "Nothing to commit"
|
|
git push
|
|
|
|
- name: Cleanup
|
|
run: |
|
|
rm -rf /home/runner/radiantwave/*
|
|
echo "Deleted all files in /home/runner/radiantwave/"
|
|
|
|
- name: Notify
|
|
if: always()
|
|
uses: https://github.com/dawidd6/action-send-mail@v3
|
|
with:
|
|
server_address: smtp.gmail.com
|
|
server_port: 587
|
|
username: ${{ secrets.MAIL_USERNAME }}
|
|
password: ${{ secrets.MAIL_PASSWORD }}
|
|
subject: "${{ job.status == 'success' && '✅' || '❌' }} KioskConfig main build ${{ job.status }}"
|
|
to: nclack@radiantwavetech.com
|
|
from: ci@radiantwavetech.com
|
|
body: "KioskConfig main build ${{ job.status }} — radiantwave updated and artifacts copied."
|