From 3d12e5e0fafb58d11326acda3a9d5dd64ff11bfb Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Wed, 6 Mar 2024 18:33:35 -0500 Subject: [PATCH] Create build-iso --- .github/workflows/build-iso | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-iso diff --git a/.github/workflows/build-iso b/.github/workflows/build-iso new file mode 100644 index 00000000..4295e9a7 --- /dev/null +++ b/.github/workflows/build-iso @@ -0,0 +1,50 @@ +name: Build NixOS iso from flake + +on: + schedule: + cron: "0 10 * * 2" + +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 + + - name: BuiCheck flake + 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: + script: nix build .#${{ matrix.target }} + + - name: Upload iso + uses: actions/upload-artifact@v3.1.2 + with: + name: ${{ env.NAME }} + path: result/iso/*.iso