Added basic backup service to fermi and daemonized main backup services #108
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |