.dotfiles/.github/workflows/main.yml
2025-07-04 18:10:10 -04:00

69 lines
2 KiB
YAML

on:
push:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
hostname: wash
arch: x86_64-linux
- os: macos-latest
hostname: MAC-C57KK2TC69
arch: aarch64-darwin
runs-on: ${{ matrix.os }}
continue-on-error: false
steps:
- name: Maximize build space
if: runner.os == 'Linux'
shell: bash
run: |
df -h
du -h -d2 / 2>/dev/null | sort -hr | head -n 20 || true
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/share/swift
sudo rm -rf /usr/lib/jvm
sudo rm -rf /usr/local/.ghcup
sudo rm -rf /home/runner/.rustup
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker system prune -af || true
sudo docker image prune -af || true
sudo docker builder prune -af || true
df -h
du -h -d2 / 2>/dev/null | sort -hr | head -n 20 || true
- uses: actions/checkout@v4
- name: install nix
uses: DeterminateSystems/nix-installer-action@main
with:
source-url: "${{ format('https://install.lix.systems/lix/lix-installer-{0}', inputs.arch) }}"
diagnostic-endpoint: ""
backtrace: "true"
- uses: cachix/cachix-action@v16
with:
name: tmayoff
authToken: '${{ secrets.CACHIX_AUTH }}'
- uses: workflow/nix-shell-action@v3
if: runner.os == 'Linux'
name: build nixos
with:
packages: nh
script: |
nh os build ./dot_config/flake#nixosConfigurations.${{matrix.hostname}} --no-nom -- --cores 1 -j1
- uses: workflow/nix-shell-action@v3
if: runner.os == 'macOS'
name: build darwin
with:
packages: nh
script: |
nh darwin build ./dot_config/flake#darwinConfigurations.${{matrix.hostname}} --no-nom -- --cores 1 -j1