Deploy infrastructure #47
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: Deploy systems | |
on: | |
check_suite: | |
types: [completed] | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
# https://github.com/sellout/bash-strict-mode/commit/9bf1d65c2f786a9887facfcb81e06d8b8b5f4667 | |
if: github.event.check_suite.app.name == 'Garnix CI' | |
&& github.event.check_suite.conclusion == 'success' | |
&& github.event.check_suite.latest_check_runs_count >= 12 | |
&& github.event.check_suite.head_branch == 'main' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Nix | |
uses: nixbuild/nix-quick-install-action@v26 | |
- name: Connect to Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:gha | |
- name: | |
run: | | |
set -eux | |
[ ! -d ~/.ssh ] && mkdir -p ~/.ssh | |
pubkeys=( | |
"atlas ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC7YiSYYx/+zmVOPSCERHzSsMeUQtA+Vt1W0sLUw4YhK" | |
) | |
for key in "${pubkeys[@]}"; do echo "$key" >> ~/.ssh/known_hosts; done | |
- name: Run deploy | |
run: | | |
nix develop --accept-flake-config \ | |
--command bash \ | |
-c "just deploy-all" |