update workflows

This commit is contained in:
Ingolf Wagner 2024-07-20 22:32:37 +02:00
parent 0aad87d144
commit 2b0fc96fba
No known key found for this signature in database
GPG key ID: 76BF5F1928B9618B
2 changed files with 59 additions and 7 deletions

View file

@ -1,6 +1,10 @@
on: [push]
name: Build all NixOS Configurations
on:
- push
jobs:
build:
nix build:
runs-on: native
steps:
- uses: actions/checkout@v4
@ -20,15 +24,30 @@ jobs:
SSH_AGENT_PID=$SSH_AGENT_PID
EOF
- run: nix flake archive
- run: nix flake check
# - run: nix flake update
- run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
- run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
- run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
- run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
- name: teardown ssh
if: always()
run: |
echo $SSH_AGENT_PID
kill $SSH_AGENT_PID
- name: nix build orbi
run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
- name: nix build cream
run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
- name: nix build cherry
run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
- name: nix build chungus
run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
#- name: teardown ssh
# if: always()
# run: |
# echo $SSH_AGENT_PID
# kill $SSH_AGENT_PID

View file

@ -0,0 +1,33 @@
name: Update Nix flakes and commit changes
on:
schedule:
- cron: "0 23 * * *"
jobs:
update-and-commit:
runs-on: native
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: "update"
fetch-depth: 0
- name: Setup Git
run: |
git config --local user.email "action@git.ingolf-wagner.de"
git config --local user.name "Forgejo Action"
- name: Rebase with main branch
run: |
git fetch origin main
git rebase origin/main
- name: Update Nix flakes
run: nix flake update
- name: Commit and Push changes
run: |
git diff --quiet && git diff --staged --quiet || (git commit -am "Update Nix flakes" && git push)