Add terraform deploy script
This commit is contained in:
parent
e40ffae4dc
commit
0fb2323b9a
41
.github/workflows/palcloud-terraform-deploy.yml
vendored
Normal file
41
.github/workflows/palcloud-terraform-deploy.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
terraform-directory:
|
||||||
|
type: string
|
||||||
|
default: terraform
|
||||||
|
variable-map:
|
||||||
|
type: string
|
||||||
|
default: "{}"
|
||||||
|
secrets:
|
||||||
|
PALTIVERSE_K8S:
|
||||||
|
required: true
|
||||||
|
TAILSCALE_TOKEN:
|
||||||
|
required: true
|
||||||
|
jobs:
|
||||||
|
deploy-palcloud-terraform:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: alpine:3
|
||||||
|
env: ${{ fromJSON(inputs.variable-map) }}
|
||||||
|
steps:
|
||||||
|
- name: Install Alpine dependencies
|
||||||
|
run: apk add nodejs npm git
|
||||||
|
- name: Install Terraform
|
||||||
|
uses: https://gitea.palk.me/paltiverse/paltiverse-actions-setup-terraform@0.0.2
|
||||||
|
- name: Connect to Paltiverse and configure kubectl
|
||||||
|
uses: https://gitea.palk.me/paltiverse/paltiverse-actions-kubectl@1.0.3
|
||||||
|
id: kubectl
|
||||||
|
with:
|
||||||
|
tailscale-token: ${{ secrets.TAILSCALE_TOKEN }}
|
||||||
|
k8s-config: ${{ secrets.PALTIVERSE_K8S }}
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Initialise Terraform (download providers)
|
||||||
|
run: terraform init
|
||||||
|
working-directory: ${{ inputs.terraform-directory }}
|
||||||
|
- name: Apply Terraform plan
|
||||||
|
run: terraform apply -auto-approve -lock-timeout=30s
|
||||||
|
working-directory: ${{ inputs.terraform-directory }}
|
||||||
|
env:
|
||||||
|
HTTP_PROXY: ${{ steps.kubectl.outputs.http-proxy }}
|
||||||
|
HTTPS_PROXY: ${{ steps.kubectl.outputs.http-proxy }}
|
||||||
|
TF_VAR_kube_config_path: ${{ steps.kubectl.outputs.k8s-config-path }}
|
Loading…
x
Reference in New Issue
Block a user