build-nixos-lima-img #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-nixos-lima-img | |
on: | |
schedule: | |
- cron: "45 5 * * Sun" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install qemu-user-static | |
run: | | |
DEBIAN_FRONTEND=noninteractive | |
sudo apt-get update -q -y && sudo apt-get install -q -y qemu-user-static | |
- name: Install Nix | |
uses: DeterminateSystems/nix-installer-action@main | |
with: | |
extra-conf: | | |
substituters = https://cache.nixos.org/ | |
system-features = kvm x86_64-linux aarch64-linux | |
extra-platforms = aarch64-linux | |
- name: Setup Nix Magic Cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build images | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
run: | | |
cd ./nixos-lima | |
export NIX_CONFIG="access-tokens = github.com=$GITHUB_TOKEN" | |
# Ensure build uses latest nixpkgs | |
nix flake update | |
nix build -o ./x86_64-img .#img | |
cp ./x86_64-img/nixos.img nixos-unstable-x86_64.img | |
nix build --system aarch64-linux -o ./arm64-img .#packages.aarch64-linux.img | |
cp ./arm64-img/nixos.img nixos-unstable-aarch64.img | |
- name: Push images to my share | |
env: | |
WEBDAV_USER: ${{ secrets.WEBDAV_USER }} | |
WEBDAV_PASSWORD: ${{ secrets.WEBDAV_PASSWORD }} | |
WEBDAV_ENDPOINT: ${{ secrets.WEBDAV_ENDPOINT }} | |
run: | | |
for file in *.img | |
do | |
curl --user "$WEBDAV_USER:$WEBDAV_PASSWORD" -T "$file" "$WEBDAV_ENDPOINT/os/$file" | |
done |