From 8e3518f2ed4f79c7cc035a947dbc9be6eccc3627 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 8 Jul 2022 09:37:26 +0800 Subject: [PATCH] .github/workflows: add automation for updating dotfiles input --- .../automate-dotfiles-input-update.yml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/automate-dotfiles-input-update.yml diff --git a/.github/workflows/automate-dotfiles-input-update.yml b/.github/workflows/automate-dotfiles-input-update.yml new file mode 100644 index 00000000..777d9c86 --- /dev/null +++ b/.github/workflows/automate-dotfiles-input-update.yml @@ -0,0 +1,30 @@ +name: "Automated flake input update for my dotfiles" +on: + schedule: + # Every day. + - cron: '30 0 * * *' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: cachix/install-nix-action@v16 + with: + nix_path: nixpkgs=channel:nixos-unstable + - name: Update flake inputs + run: | + nix shell nixpkgs#git + + # This is set by the GitHub Actions bot just to make identifying which commits are automated. + git config user.name 'github-actions[bot]' + git config user.email 'github-actions[bot]@users.noreply.github.com' + + nix flake lock --update-input 'dotfiles' --commit-lock-file --commit-lockfile-summary "flake.lock: update dotfiles" + - name: Build NixOS configurations that uses the dotfiles + run: nix build .#nixosConfigurations.ni.config.system.build.toplevel + - name: Push updates to remote + run: | + nix flake lock --commit-lock-file + git remote remove origin + git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/foo-dogsquared/nixos-config.git + git push --set-upstream origin master --tags