This commit is contained in:
parent
4ed9ba0d24
commit
a90630ecb6
98 changed files with 2063 additions and 729 deletions
39
.forgejo/workflows/deploy-nixos.yaml
Normal file
39
.forgejo/workflows/deploy-nixos.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
name: Deploy NixOS VM
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: nixos/nix
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Terraform
|
||||
run: nix-env -iA nixpkgs.terraform
|
||||
|
||||
- name: Setup SSH key
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
env:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
|
||||
- name: Terraform Init & Apply
|
||||
run: |
|
||||
terraform init
|
||||
terraform apply -auto-approve
|
||||
working-directory: ./terraform
|
||||
env:
|
||||
PROXMOX_PASSWORD: ${{ secrets.PROXMOX_PASSWORD }}
|
||||
|
||||
- name: Deploy NixOS via nixos-anywhere
|
||||
run: |
|
||||
nix run github:numtide/nixos-anywhere -- \
|
||||
--build-on-remote \
|
||||
--flake .#new-vm \
|
||||
root@<new-vm-ip>
|
||||
Loading…
Add table
Add a link
Reference in a new issue