-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (48 loc) · 1.26 KB
/
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
49
name: "Automated update"
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:
push:
branches:
- main
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
ref: main
token: "${{ secrets.PAT_FOR_AUTOMATED_UPDATE }}"
- name: Install nix
uses: cachix/install-nix-action@master
with:
github_access_token: "${{ secrets.GITHUB_TOKEN }}"
- name: Setup cachix
uses: cachix/cachix-action@master
with:
name: linyinfeng
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: Git config
run: |
git config --global user.email "nano@linyinfeng.com"
git config --global user.name "Nano"
- name: Nix flake update
run: |
nix flake update --commit-lock-file
- name: Cargo update
run: |
nix develop --command cargo update
if [ -z $(git status --porcelain) ]; then
echo "clean, skip..."
else
git add --all
git commit --message "Cargo update"
fi
- name: Nix flake check
run: |
nix flake check
- name: Git push
run: |
git push