add darwin deploy action

This commit is contained in:
zowoq 2023-11-10 12:03:53 +10:00
parent accf44e44c
commit 45c02a685c

50
.github/workflows/darwin.yml vendored Normal file
View file

@ -0,0 +1,50 @@
name: "darwin"
on:
push:
branches: [master]
workflow_dispatch:
concurrency:
group: "darwin"
cancel-in-progress: false
jobs:
deploy:
environment:
name: darwin
strategy:
fail-fast: false
matrix:
host: [darwin02, darwin03]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
accept-flake-config = true
experimental-features = nix-command flakes
- name: Setup SSH
env:
SSH_KEY: "${{ secrets.SSH_KEY }}"
run: |
mkdir -p "$HOME/.ssh"
cat >>"$HOME/.ssh/id_ed25519" <<EOF
$SSH_KEY
EOF
chmod 600 "$HOME/.ssh/id_ed25519"
cat >>"$HOME/.ssh/known_hosts" <<EOF
darwin02.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICJqwpMUEl1/iwrBakeDb1rlheXlE5mfDLICVz8w6yi6
darwin03.nix-community.org ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKX7W1ztzAtVXT+NBMITU+JLXcIE5HTEOd7Q3fQNu80S
EOF
cat >>"$HOME/.ssh/config" <<EOF
Host *
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes
User hetzner
EOF
- name: Deploy
run: |
./inv deploy --hosts ${{ matrix.host }}