Update Nix packages daily #277
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update Nix packages daily | |
| on: | |
| schedule: | |
| # Run at 00:00 UTC every day | |
| - cron: '0 0 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-nix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v27 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Update Nix packages | |
| run: | | |
| # cd node2nix/ | |
| # nix-shell -p nodePackages.node2nix --command "node2nix -i ./node-packages.json -o node-packages.nix" | |
| # cd .. | |
| nix flake update | |
| nix fmt --verbose | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add flake.lock node2nix/node-packages.nix | |
| git commit -m "Update node2nix and flake.lock" || echo "No changes to commit" | |
| - name: Push changes | |
| run: | | |
| git push origin HEAD |