Skip to content

Commit

Permalink
ci: split updating flake to another workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DavSanchez committed Nov 20, 2023
1 parent 9870c93 commit 96b1ab6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 16 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/update-flake-inputs.yml
Original file line number Diff line number Diff line change
@@ -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 '[email protected]
- 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

0 comments on commit 96b1ab6

Please sign in to comment.