48 lines
1.0 KiB
YAML
48 lines
1.0 KiB
YAML
name: Gitea Actions Demo
|
|
run-name: ${{ gitea.actor }} is deploying with Terraform 🚀
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
terraform:
|
|
name: "Terraform Apply"
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
env:
|
|
TF_VAR_TS_AUTHKEY: ${{ secrets.TAILSCALE_KEY }}
|
|
TF_VAR_ssh_key: ${{ secrets.SSH_PUBLIC_KEY }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Terraform
|
|
uses: hashicorp/setup-terraform@v2
|
|
with:
|
|
terraform_version: 1.6.6
|
|
|
|
- name: Inject sensitive secrets
|
|
working-directory: terraform
|
|
run: |
|
|
echo 'proxmox_password = "${{ secrets.PROXMOX_PASSWORD }}"' >> terraform.tfvars
|
|
|
|
- name: Terraform Init
|
|
working-directory: terraform
|
|
run: terraform init
|
|
|
|
- name: Terraform Plan
|
|
working-directory: terraform
|
|
run: terraform plan
|
|
|
|
- name: Terraform Apply
|
|
working-directory: terraform
|
|
run: terraform apply -auto-approve
|
|
|