diff options
| author | seth <[email protected]> | 2023-12-13 23:12:51 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2023-12-13 23:19:09 -0500 |
| commit | 974decdfa3449f47892532f9ac728275fb9fa2df (patch) | |
| tree | 32b5491239060c74cbf3b27ca51bc620b5e62b4f /.github/workflows/deploy.yaml | |
| parent | 0be27ca642a9f30442d8c0566d00131da5e6b5d0 (diff) | |
tf: debrand config
Diffstat (limited to '.github/workflows/deploy.yaml')
| -rw-r--r-- | .github/workflows/deploy.yaml | 103 |
1 files changed, 54 insertions, 49 deletions
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 9a00df7..083269b 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -49,52 +49,57 @@ jobs: nix develop --accept-flake-config \ --command deploy - #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 cache - # uses: terraform-cache/terraform-cache@v1 - - # - 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: Generate configuration - # run: nix run .#gen-tofu - - # - name: Run plan - # run: | - # nix develop --accept-flake-config \ - # --command tofu plan - - # - name: Apply - # run: | - # nix develop --accept-flake-config \ - # --command tofu apply -auto-approve + 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 cache + uses: terraform-cache/terraform-cache@v1 + + - 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: Generate configuration + run: nix run .#gen-tf + + - name: Init workspace + run: | + nix develop --accept-flake-config \ + --command tofu init + + - name: Validate plan + run: | + nix develop --accept-flake-config \ + --command tofu validate + + - name: Apply + run: | + nix develop --accept-flake-config \ + --command tofu apply -auto-approve |
