From 03cea3ba8fea453fa5ca1611c7d8af152e2fcaaa Mon Sep 17 00:00:00 2001 From: seth Date: Mon, 11 Dec 2023 19:08:10 -0500 Subject: start using opentofu --- .github/workflows/deploy.yaml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to '.github/workflows/deploy.yaml') diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 34f4f26..0f3f1ed 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Deploy systems +name: Deploy infrastructure on: check_suite: @@ -6,7 +6,9 @@ on: workflow_dispatch: jobs: - deploy: + nixos: + name: Deploy NixOS systems + runs-on: ubuntu-latest concurrency: @@ -46,3 +48,36 @@ jobs: run: | nix develop --accept-flake-config \ --command just deploy-all + + opentofu: + name: Apply OpenTofu plan + needs: nixos + + runs-on: ubuntu-latest + + concurrency: + group: tofu + cancel-in-progress: true + + steps: + - uses: actions/checkout@v4 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v9 + + - name: Setup local Nix cache + uses: DeterminateSystems/magic-nix-cache-action@v2 + + - name: Setup OpenTofu + uses: opentofu/setup-opentofu@v1 + with: + cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }} + + - name: Setup OpenTofu cache + uses: terraform-cache/terraform-cache@v1 + + - name: Run plan + run: nix run .#plan + + - name: Apply + run: tofu apply -- cgit v1.2.3