diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4193db7..d232145c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,26 +1,30 @@ -name: Update flake inputs +name: Build all Nix configurations on: - schedule: - # 1st and 15th of each month at midnight UTC - - cron: '0 0 1,15 * *' + pull_request: + branches: [master] + push: + branches: [master] + # schedule: + # # 1st and 15th of each month at midnight UTC + # - cron: '0 0 1,15 * *' workflow_dispatch: jobs: - update_flake_inputs: - name: Update flake inputs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v7 - - name: Update flake inputs - run: nix flake update + # update_flake_inputs: + # name: Update flake inputs + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Install Nix + # uses: DeterminateSystems/nix-installer-action@v7 + # - name: Update flake inputs + # run: nix flake update test_nixos_builds: name: Build NixOS configurations runs-on: ubuntu-latest - needs: [update_flake_inputs] + # needs: [update_flake_inputs] container: image: nix/nixos:latest env: @@ -34,7 +38,7 @@ jobs: test_darwin_builds: name: Build Darwin configurations runs-on: macos-latest - needs: [update_flake_inputs] + # needs: [update_flake_inputs] steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@v7 @@ -51,7 +55,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} - needs: [update_flake_inputs] + # needs: [update_flake_inputs] steps: - name: Install Nix uses: DeterminateSystems/nix-installer-action@v7 diff --git a/.github/workflows/update-flake-inputs.yml b/.github/workflows/update-flake-inputs.yml new file mode 100644 index 00000000..50f56936 --- /dev/null +++ b/.github/workflows/update-flake-inputs.yml @@ -0,0 +1,30 @@ +name: Update flake inputs +on: + schedule: + # 1st and 15th of each month at midnight UTC + - cron: '0 0 1,15 * *' + workflow_dispatch: + +jobs: + + update_flake_inputs: + name: Update flake inputs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up git user + run: | + git config --global user.name 'DavSanchez's GitHub Actions' + git config --global user.email 'DavSanchez+automation@users.noreply.github.com + - name: Checkout a new branch + run: git switch -c chore/update-flake-inputs + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v7 + - name: Update flake inputs + run: nix flake update --commit-lock-file + - name: Create Pull Request using GH CLI + run: | + gh pr create --title "chore: update flake inputs" --body "Update flake inputs" + - name: Set branch for auto-merge + run: gh pr merge --squash --auto --delete-branch +