-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1.01 KB
/
deploy.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
name: deploy
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
deploy-fermi:
name: Deploy fermi NixOS server
runs-on: ubuntu-latest
if: ${{ github.event_name == 'workflow_dispatch' || !github.event.forced }}
concurrency:
group: deploy-fermi
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Create ssh key from repository secrets
run: |
install -m 600 -D /dev/stdin ~/.ssh/id_ed25519 <<< "${{ secrets.PRIVATE_KEY }}"
- name: Add VPS fingerprint to known ssh hosts
run: ssh-keyscan -H 170.130.165.174 > ~/.ssh/known_hosts
- name: Deploy fermi
run: |
nix run 'github:serokell/deploy-rs' '.#fermi' -- --ssh-user aftix -- --impure
ssh [email protected] 'sh -ls' <<< "$SCRIPT"
env:
SCRIPT: >-
cd $HOME/cfg ;
git pull --rebase