From c3513296403a64e46c13026c840838b48c4fde07 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Fri, 25 Oct 2024 18:11:16 -0700 Subject: [PATCH] #17 Fix long-lived typo in cluster name "Silver-hand" -> "Silver-flame" --- .gitea/workflows/silver-flame-deploy.yaml | 46 +++++++++++++++++++++++ .gitea/workflows/silver-hand-deploy.yaml | 28 -------------- 2 files changed, 46 insertions(+), 28 deletions(-) create mode 100644 .gitea/workflows/silver-flame-deploy.yaml delete mode 100644 .gitea/workflows/silver-hand-deploy.yaml diff --git a/.gitea/workflows/silver-flame-deploy.yaml b/.gitea/workflows/silver-flame-deploy.yaml new file mode 100644 index 00000000..f931b175 --- /dev/null +++ b/.gitea/workflows/silver-flame-deploy.yaml @@ -0,0 +1,46 @@ +name: Deploy NixOS System Configurations to Silver-Flame Hosts + +on: + push: + branches: [ main ] + paths: [ 'homelab/silver-flame/**' ] + +jobs: + deploy: + defaults: + run: + working-directory: homelab/silver-flame + runs-on: ubuntu-latest + steps: + - name: Checkout Jafner.net repo + uses: actions/checkout@v4 + - name: Install jq + run: sudo apt-get update && sudo apt-get install jq + - name: Install Nix + uses: cachix/install-nix-action@v30 + with: + github_access_token: ${{ secrets.RUNNER_GITHUB_TOKEN }} + nix_path: nixpkgs=channel:nixos-24.05 + - name: Configure SSH key + run: | + echo -e "${{ secrets.RUNNER_SSH_PRIVATEKEY }}" > /tmp/key + chmod 600 /tmp/key + ssh -i /tmp/key + - name: Get list of hosts + run: | + nix eval --json .#deploy.nodes --apply 'builtins.attrValues' |\ + jq -r '.[].hostname' | xargs echo > /tmp/hostlist + - name: Add known hosts + run: | + mkdir -p ~/.ssh && touch ~/.ssh/known_hosts && chmod 600 ~/.ssh/known_hosts + for host in $(cat /tmp/hostlist); do + ssh-keyscan -t ed25519 $host >> ~/.ssh/known_hosts + done + - name: Test SSH connections + run: | + for host in $(cat /tmp/hostlist); do + ssh -i /tmp/key root@$host 'whoami; echo $HOSTNAME' + done + # - name: Run deploy-rs from flake + # run: | + # nix run github:serokell/deploy-rs#defaultPackage.x86_64-linux -- --version \ No newline at end of file diff --git a/.gitea/workflows/silver-hand-deploy.yaml b/.gitea/workflows/silver-hand-deploy.yaml deleted file mode 100644 index 3341f9fe..00000000 --- a/.gitea/workflows/silver-hand-deploy.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Deploy NixOS System Configurations to Silver-Hand Hosts - -on: - push: - branches: [ main ] - paths: [ 'nix/nix-lab/**' ] - -jobs: - deploy: - defaults: - run: - working-directory: nix/nix-lab - runs-on: ubuntu-latest - steps: - - name: Checkout Jafner.net repo - uses: actions/checkout@v4 - - name: Install Nix - uses: cachix/install-nix-action@v30 - with: - github_access_token: ${{ secrets.RUNNER_GITHUB_TOKEN }} - nix_path: nixpkgs=channel:nixos-24.05 - - name: Check Nix Install - run: | - nix flake show github:NixOS/nixpkgs - nix --version - - name: Run deploy-rs from flake - run: | - nix run github:serokell/deploy-rs#defaultPackage.x86_64-linux -- --version \ No newline at end of file