mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-04-24 18:19:11 +00:00
chore: add flake update automation
This is used for testing updates and gauging how up-to-date my config is. In case of failure, it should not update it.
This commit is contained in:
parent
bd915fd374
commit
a8820aae0f
32
.github/workflows/automate-update.yml
vendored
Normal file
32
.github/workflows/automate-update.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
name: "Automated flake inputs update"
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# Every week on Friday.
|
||||||
|
- cron: '0 * * * 5'
|
||||||
|
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 update --commit-lock-file \
|
||||||
|
--commit-lockfile-summary 'flake.lock: update-inputs'
|
||||||
|
- name: Build custom packages
|
||||||
|
run: nix shell nixpkgs#nix-build-uncached --command nix-build-uncached ./pkgs
|
||||||
|
- name: Build NixOS configurations
|
||||||
|
run: nix build .#nixosConfigurations.ni.config.system.build.toplevel
|
||||||
|
- name: Push updates to remote
|
||||||
|
run: |
|
||||||
|
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
|
Loading…
Reference in New Issue
Block a user