-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.26 KB
/
update.yml
File metadata and controls
41 lines (41 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "update flake"
on:
schedule:
- cron: "15 4 * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
outputs: ${{ steps.gen_output.outputs.outputs }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install nix
uses: cachix/install-nix-action@v31
- name: Update flake.lock
run: nix flake update
- name: Add flake.lock
run: git add flake.lock
- name: Check updated flake
run: nix flake check --all-systems
- name: Push new flake.lock
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Update Flake Inputs: $(date +%F)"
git push
- name: Get outputs
id: gen_output
run: echo "outputs=$(nix flake show --json | jq -c '.nixosConfigurations | keys | map("nixosConfigurations.\(.).config.system.build.toplevel")')" >> "$GITHUB_OUTPUT"
cache:
needs: update
strategy:
matrix:
output: ${{fromJson(needs.update.outputs.outputs)}}
uses: ./.github/workflows/cache.yml
with:
output: ${{ matrix.output }}
secrets: inherit