name: "Build personalized bootstrap ISO"
on:
  push:
    branches:
      - master
      - develop
jobs:
  build-iso:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: cachix/install-nix-action@v16
        with:
          nix_path: nixpkgs=channel:nixos-unstable
      - name: Build ISO
        id: build-iso
        # TODO: Use the registry.
        run: |
          nix build .#bootstrap-install-iso --out-link build-iso-result
      - name: Create release
        if: github.ref == 'refs/heads/master'
        id: create-release
        uses: marvinpinto/action-automatic-releases@v1.2.1
        with:
          repo_token: "${{ secrets.GITHUB_TOKEN }}"
          automatic_release_tag: latest
          prerelease: true
          title: Latest release
          files:
            build-iso-result/iso/bootstrap-*.iso