summaryrefslogtreecommitdiff
path: root/.github/workflows/deploy.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/deploy.yaml')
-rw-r--r--.github/workflows/deploy.yaml96
1 files changed, 0 insertions, 96 deletions
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml
deleted file mode 100644
index 388f3ac..0000000
--- a/.github/workflows/deploy.yaml
+++ /dev/null
@@ -1,96 +0,0 @@
-name: Deploy infrastructure
-
-on:
- push:
- branches: [main]
- workflow_dispatch:
-
-jobs:
- ci:
- name: CI
- uses: ./.github/workflows/ci.yaml
- secrets: inherit
-
- nixos:
- needs: ci
-
- name: Deploy NixOS systems
- runs-on: ubuntu-latest
-
- environment: nixos
- concurrency:
- group: nixos
- cancel-in-progress: true
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Install Nix
- uses: DeterminateSystems/nix-installer-action@v9
-
- - 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: Copy known_hosts
- run: |
- set -eux
-
- [ ! -d ~/.ssh ] && mkdir -p ~/.ssh
- cp .known_hosts ~/.ssh/known_hosts
-
- - name: Run deploy
- run: |
- args=(
- --inputs-from .
- nixpkgs#just
- --command
- just deploy-all
- )
-
- nix shell "${args[@]}"
-
- terranix:
- needs: nixos
-
- name: Apply Terranix plan
- runs-on: ubuntu-latest
-
- environment: terranix
- concurrency:
- group: terranix
- cancel-in-progress: true
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Install Nix
- uses: DeterminateSystems/nix-installer-action@v9
-
- - name: Authenticate with TF Cloud
- run: |
- dir="$HOME/.terraform.d"
- [ ! -d "$dir" ] && mkdir -p "$dir"
-
- cat > "$dir"/credentials.tfrc.json << EOF
- {
- "credentials": {
- "app.terraform.io": {
- "token": "${{ secrets.TF_API_TOKEN }}"
- }
- }
- }
- EOF
-
- - name: Apply plan
- env:
- CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
- OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
- OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
- run: |
- nix develop .#terranix \
- --command bash -c \
- 'tofu init && tofu validate && tofu apply -auto-approve && just clean'