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)