Skip to content

darwin

darwin #32

Workflow file for this run

name: "darwin"
on:
status:
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
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'status' && github.event.context == 'buildbot/nix-eval' && github.event.state == 'success' && github.ref == 'refs/heads/master')
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 }}
- name: Alert on failure
if: ${{ failure() }}
run: |
curl -XPOST -d '{"msgtype":"m.text", "body":"${{ matrix.host }}: deployment failed"}' \
"https://matrix.org/_matrix/client/r0/rooms/!cBybDCkeRlSWfuaFvn:numtide.com/send/m.room.message?access_token=${{ secrets.TOKEN_MATRIX_BOT }}"