From ec9f46a7baa1db02e4f446c0356daa56760e6aa1 Mon Sep 17 00:00:00 2001 From: Pal Kerecsenyi Date: Tue, 2 Apr 2024 17:33:50 +0100 Subject: [PATCH] Initial commit --- action.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..1a944f6 --- /dev/null +++ b/action.yml @@ -0,0 +1,40 @@ +name: "Deploy using Terraform and PalCloud Kubernetes" +description: "Connects to PalCloud via Tailscale and runs a Terraform deploy with Kubernetes support" +inputs: + tailscale-token: + description: "An authKey for connecting to Tailscale" + required: true + k8s-config: + description: "A kubeconfig file for authenticating with the kube-api" + required: true + terraform-directory: + description: "The directory containing your tf files" + required: true +runs: + using: composite + steps: + - name: Install Alpine dependencies + run: apk add nodejs npm git + shell: sh + - name: Install Terraform + uses: https://gitea.palk.me/paltiverse/paltiverse-actions-setup-terraform@0.0.2 + shell: sh + - name: Connect to Paltiverse and configure kubectl + uses: https://gitea.palk.me/paltiverse/paltiverse-actions-kubectl@1.0.3 + id: kubectl + with: + tailscale-token: ${{ inputs.tailscale-token }} + k8s-config: ${{ inputs.k8s-config }} + shell: sh + - name: Initialise Terraform (download providers) + run: terraform init + working-directory: ${{ inputs.terraform-directory }} + shell: sh + - name: Apply Terraform plan + run: terraform apply -auto-approve -lock-timeout=30s + working-directory: ${{ inputs.terraform-directory }} + shell: sh + 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 }}