-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (50 loc) · 1.56 KB
/
build_homelab_yaml.yaml
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
54
55
56
57
58
name: "build_homelab_yaml"
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'cluster/**'
jobs:
build_homelab_yaml:
runs-on: ubuntu-latest
steps:
- name: install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
- name: checkout main
uses: actions/checkout@v4
- name: build homelab
uses: arnarg/nixidy/actions/build@main
id: build
with:
environment: .#homelab
- name: checkout homelab
uses: actions/checkout@v4
with:
ref: homelab
path: ./homelab
- name: remove files
working-directory: ./homelab
run: |
pwd
touch content-to-enable-rm-on-empty-dir
echo "remove files:"
echo `ls -a | grep -v "^.$\|^..$\|^.git$\|^.gitignore$"`
rm -r `ls -a | grep -v "^.$\|^..$\|^.git$\|^.gitignore$"`
- name: copy build
run: |
echo ${{ steps.build.outputs.out-path }}
rsync --copy-links --copy-dirlinks --recursive '${{steps.build.outputs.out-path}}/' homelab
- name: commit and push changes
working-directory: ./homelab
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add --all
git commit -m 'update homelab configuration'
git push origin homelab