-
-
Notifications
You must be signed in to change notification settings - Fork 6
58 lines (49 loc) · 1.7 KB
/
deploy-server.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
54
55
56
57
58
name: Deploy Server
on:
push:
branches:
- master
paths:
- 'nixos/server'
workflow_dispatch:
workflow_call:
secrets:
SSH_PRIVATE_KEY:
required: true
SSH_CONFIG:
required: true
KNOWN_HOSTS:
required: true
jobs:
deploy-server:
runs-on: ubuntu-latest
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
name: id_rsa # optional
known_hosts: ${{ secrets.KNOWN_HOSTS }}
config: ${{ secrets.SSH_CONFIG }} # ssh_config; optional
if_key_exists: fail
- name: rsync over SSH
run: rsync -r . [email protected]:bar/
- uses: actions/[email protected]
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-23.11
- uses: workflow/[email protected]
with:
packages: rsync
working-directory: nixos/server
script: |
rsync -r . [email protected]:bar
- uses: workflow/[email protected]
with:
packages: nixos-rebuild
working-directory: nixos/server
script: |
nixos-rebuild switch --verbose --fast --flake ".#nixos" --use-remote-sudo --target-host "[email protected]" --build-host "[email protected]" --builders "ssh://[email protected] aarch64-linux"
nixos-rebuild switch --verbose --fast --flake ".#nixos" --use-remote-sudo --target-host "[email protected]" --build-host "[email protected]" --builders '"ssh://[email protected] aarch64-linux"'