-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.56 KB
/
ci.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
name: "Build Systems"
on:
schedule:
- cron: '0 15 * * *'
push:
pull_request:
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Maximize space
run: |
bash .github/scripts/cleanup.sh
- name: Install nixFlake
uses: cachix/install-nix-action@v20
with:
extra_nix_config: |
experimental-features = nix-command flakes
extra-trusted-public-keys = nixos-cn.cachix.org-1:L0jEaL6w7kwQOPlLoCR3ADx+E3Q8SEFEcB9Jaibl0Xg= emerge.cachix.org-1:Zvw8m0TXudK0MtylBFvUZCUEHlOfTgfvE2bbIexGhVw=
extra-substituters = https://nixos-cn.cachix.org https://emerge.cachix.org
- uses: cachix/cachix-action@v14
with:
name: emerge
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Configure git
run: |
git config --global user.name 'Automation - Ninlives'
git config --global user.email 'wqseleven@gmail.com'
- name: Update dependencies
run: |
eval $(ssh-agent)
echo "${{ secrets.VALUES_SSH_KEY }}"|ssh-add -
nix flake update
- name: Build system
run: nix build .#nixosConfigurations.lego.config.system.build.toplevel --print-build-logs --show-trace
- name: Build terraform configuration
run: nix build .#terraformConfigurations.zero --print-build-logs --show-trace
- name: Commit if build succeed
run: |
git diff-index --quiet HEAD \
|| (git commit -am "Update dependencies - Automated Commit" && git push || git stash)