From 2b0fc96fba10bb53b212795c85cddb5898a9e55d Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Sat, 20 Jul 2024 22:32:37 +0200 Subject: [PATCH] update workflows --- .forgejo/workflows/build.yaml | 33 +++++++++++++++++++----- .forgejo/workflows/update_nix_flakes.yml | 33 ++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 .forgejo/workflows/update_nix_flakes.yml diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 8dcdbb5..bb2213a 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -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 diff --git a/.forgejo/workflows/update_nix_flakes.yml b/.forgejo/workflows/update_nix_flakes.yml new file mode 100644 index 0000000..a99fd9b --- /dev/null +++ b/.forgejo/workflows/update_nix_flakes.yml @@ -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)