change workflow to use she commands
Some checks failed
Activate NixOS Homelab Configuration On Push / build-and-activate (push) Failing after 1m26s
Some checks failed
Activate NixOS Homelab Configuration On Push / build-and-activate (push) Failing after 1m26s
This commit is contained in:
parent
59d1b62395
commit
719548c778
1 changed files with 10 additions and 28 deletions
|
|
@ -1,42 +1,24 @@
|
||||||
name: Activate NixOS Homelab Configuration On Push
|
name: Activate NixOS Homelab Configuration On Push
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PATH: /run/current-system/sw/bin:/run/wrappers/bin
|
PATH: /run/current-system/sw/bin:/run/wrappers/bin
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-and-activate:
|
||||||
runs-on: self-hosted
|
runs-on: self-hosted
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: /bin/sh -e {0}
|
shell: /bin/sh -e {0}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# - name: Clone Repository
|
- name: Clone
|
||||||
# run: |
|
run: git clone -v http://localhost:5080/satr14/nix-flake.git src
|
||||||
# rm -rf src
|
- name: Build
|
||||||
# git clone https://git.satr14.my.id/satr14/nix-flake.git src
|
run: nixos-rebuild build --flake ./src#homelab -L --show-trace -v
|
||||||
|
- name: Activate
|
||||||
# - name: Setup SSH Key
|
run: sudo nixos-rebuild switch --flake ./src#homelab -L --show-trace -v
|
||||||
# run: |
|
- name: Clean
|
||||||
# mkdir -p ~/.ssh
|
run: rm -rfv src
|
||||||
# echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
|
||||||
# chmod 600 ~/.ssh/id_ed25519
|
|
||||||
# printf '%s\n' 'Host localhost 127.0.0.1 ::1' ' StrictHostKeyChecking no' ' UserKnownHostsFile /dev/null' >> ~/.ssh/config
|
|
||||||
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup SSH
|
|
||||||
id: setupssh
|
|
||||||
uses: actions/setup-ssh@v1
|
|
||||||
with:
|
|
||||||
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
||||||
|
|
||||||
- name: Deploy System over SSH
|
|
||||||
run: nixos-rebuild switch --flake ./src#homelab --target-host root@localhost -L --show-trace
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue