-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (52 loc) · 1.5 KB
/
flake-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
50
51
52
53
name: "Flake Automated Update"
on:
workflow_dispatch:
schedule:
- cron: '0 11 * * *'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
with:
token: '${{ secrets.ACTION_GITHUB_TOKEN }}'
- name: Install nix
uses: cachix/install-nix-action@master
with:
github_access_token: '${{ secrets.ACTION_GITHUB_TOKEN }}'
- name: Import GPG key
id: import-gpg
uses: crazy-max/ghaction-import-gpg@master
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Configure git credentials
run: |
git config --global user.email "${{ steps.import-gpg.outputs.email }}"
git config --global user.name "${{ steps.import-gpg.outputs.name }}"
- name: Setup cachix
uses: cachix/cachix-action@master
with:
name: antares0982
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Nix flake update
run: |
nix flake update --commit-lock-file
- name: Nix develop check
run: |
nix develop --command echo DONE
nix flake check
if [ -z $(git status --porcelain) ]; then
echo "clean, skip..."
else
git add --all
git commit --message "Flake Update"
fi
- name: Git push
run: |
git config --global pull.rebase false
git pull
git push