55 lines
1.8 KiB
YAML
55 lines
1.8 KiB
YAML
name: Build on Push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch: # Allow manual trigger
|
|
|
|
jobs:
|
|
build-configurations:
|
|
runs-on: nixos
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure Attic cache
|
|
run: |
|
|
# Configure attic client to use your cache server
|
|
attic login servidos http://127.0.0.1:2343 ${{ secrets.ATTIC_TOKEN }}
|
|
|
|
- name: Build workstation configuration
|
|
run: |
|
|
echo "Building workstation configuration..."
|
|
nix build .#nixosConfigurations.workstation.config.system.build.toplevel --quiet
|
|
|
|
- name: Build server configuration
|
|
run: |
|
|
echo "Building server configuration..."
|
|
nix build .#nixosConfigurations.server.config.system.build.toplevel --quiet
|
|
|
|
- name: Build emacs-vm configuration
|
|
run: |
|
|
echo "Building emacs-vm configuration..."
|
|
nix build .#emacs-vm --quiet
|
|
|
|
- name: Push to cache
|
|
run: |
|
|
echo "Pushing builds to cache..."
|
|
# Push all built derivations to cache
|
|
if ls result* 1> /dev/null 2>&1; then
|
|
attic push servidos:nixos result*
|
|
fi
|
|
|
|
# Push the specific system derivations we just built
|
|
nix build .#nixosConfigurations.workstation.config.system.build.toplevel --print-out-paths | attic push servidos:nixos --stdin
|
|
nix build .#nixosConfigurations.server.config.system.build.toplevel --print-out-paths | attic push servidos:nixos --stdin
|
|
nix build .#emacs-vm --print-out-paths | attic push servidos:nixos --stdin
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "✅ Build on push completed successfully!"
|
|
echo "- Built workstation, server, and emacs-vm configurations"
|
|
echo "- Pushed all builds to Atticd cache"
|
|
|