initial commit, after deletion :)

This commit is contained in:
toufic ar 2026-01-07 06:25:07 +02:00
commit 9ec37597b3
Signed by: toufic ar
SSH key fingerprint: SHA256:/NaO5I1nG3gYKzrzSiTYIdRyaIYxDWfr1U+d+yfJ/4k
20 changed files with 1006 additions and 0 deletions

View file

@ -0,0 +1,37 @@
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout repo
uses: actions/checkout@v6
- name: install necessary packages
run: |
set -e
apt update
apt install rsync -y
- name: add ssh key
run: |
set -e
mkdir -p /root/.ssh
ssh-keyscan toufy.me >> /root/.ssh/known_hosts
chmod -R 600 /root/.ssh
eval $(ssh-agent -s)
echo "${{ secrets.SSH_KEY }}" | tr -d "\r" | ssh-add -
- name: copy repo to target
run: rsync -az . root@toufy.me:/tmp/deploy
- name: nixos-rebuild test
run: |
set -e
ssh root@toufy.me -C "nixos-rebuild test --flake /tmp/deploy --impure"
[ "$?" == 0 ] || exit 1
- name: nixos-rebuild switch
run: |
set -e
ssh root@toufy.me -C "nixos-rebuild switch --flake /tmp/deploy --impure"
[ "$?" == 0 ] || exit 1
- name: clean up
run: ssh root@toufy.me -C "rm -rf /tmp/deploy"