nixcfg/.github/workflows/build-iso.yml

54 lines
1.4 KiB
YAML
Raw Normal View History

2024-03-06 18:43:19 -05:00
name: Build NixOS iso
2024-03-06 18:33:35 -05:00
on:
schedule:
2024-03-06 18:41:45 -05:00
- cron: "0 10 * * 2"
2024-03-06 18:44:21 -05:00
workflow_dispatch:
2024-03-06 18:33:35 -05:00
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target: [
live-gnome-unstable
]
steps:
- uses: actions/checkout@v3
- name: Cache date
run: echo "DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
- name: Filename friendly date
run: echo "BUILD_DATE=$(echo $DATE | sed -r -e 's/:/./g' -e 's/ /_/g')" >> $GITHUB_ENV
- name: Store branch name
run: echo "BUILD_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Store commit hash
run: echo "BUILD_COMMIT=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
- name: Generate output name
run: echo "NAME=${BUILD_DATE}_${BUILD_BRANCH}_${BUILD_COMMIT}_nixos_iso_${{ matrix.target }}" >> $GITHUB_ENV
- name: Install Nix
uses: cachix/install-nix-action@v20
2024-03-06 18:50:51 -05:00
- name: Check flake
2024-03-06 18:33:35 -05:00
uses: workflow/nix-shell-action@v3.2.1
with:
script: nix flake check .
- name: Build image
uses: workflow/nix-shell-action@v3.2.1
with:
2024-03-06 18:50:51 -05:00
script: nix build .#nixosConfigurations.${{ matrix.target }}.config.system.build.isoImage
2024-03-06 18:33:35 -05:00
- name: Delete nix store
run: sudo rm -rf /nix
2024-03-06 18:33:35 -05:00
- name: Upload iso
uses: actions/upload-artifact@v3.1.2
with:
name: ${{ env.NAME }}
2024-03-06 18:50:51 -05:00
path: result/iso/*.iso