add darwin deploy action
This commit is contained in:
parent
accf44e44c
commit
45c02a685c
1 changed files with 50 additions and 0 deletions
50
.github/workflows/darwin.yml
vendored
Normal file
50
.github/workflows/darwin.yml
vendored
Normal 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 }}
|
Loading…
Add table
Add a link
Reference in a new issue