-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.13 KB
/
auto-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: "Auto update packages"
on:
workflow_dispatch:
schedule:
- cron: "10 3 * * *"
jobs:
build:
name: update
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Cache Nvfetcher Database
id: cache-nvfetcher
uses: actions/cache@v4
with:
path: ~/.local/share/nvfetcher
key: nvfetcher
- name: Build nix packages
run: |
cat > secrets.toml <<EOF
[keys]
github = "${{ secrets.GITHUB_TOKEN }}"
EOF
nix develop -c nvfetcher
rm -f secrets.toml
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add _sources
git commit -m "chore: update sources" || echo "No changes to commit"
- name: Push changes
run: |
git push