flake.lock: Update #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
- 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 }}" |