Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
package

GitHub Action

TerrakubeAction

0.3.9 Pre-release

TerrakubeAction

package

TerrakubeAction

Github integration with Terrakube Platform

Installation

Copy and paste the following snippet into your .yml file.

              

- name: TerrakubeAction

uses: AzBuilder/[email protected]

Learn more about this action in AzBuilder/terrakube-action-github

Choose a version

terrakube-action-github

This is an example to show how easy is to integrate Terrakube with GitHub Actions.

YAML Definition

Add the following snippet to the script section of your github actions file:

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: AzBuilder/[email protected]
      with:
        TERRAKUBE_TOKEN: "xxxxxx" # Terrakube Personal Access Token
        TERRAKUBE_TEMPLATE: "Terraform-Plan"
        TERRAKUBE_REPOSITORY: "https://github.com/AzBuilder/terraform-sample-repository.git"
        TERRAKUBE_ENDPOINT: "https://terrakube.interal/service"
        TERRAKUBE_BRANCH: ${{ github.head_ref }}
        GITHUB_TOKEN: "xxxx"

Variables

Variable Usage
TERRAKUBE_TOKEN (*) Terrakube Personal Access Token
TERRAKUBE_REPOSITORY (*) Terrakube git repository
TERRAKUBE_TEMPLATE (*) Terrakube template name
TERRAKUBE_ENDPOINT (*) Terrakbue api endpoint
TERRAKUBE_BRANCH (*) Github Branch when running a job
GITHUB_TOKEN (*) Github Token

(*) = required variable.

Configuration

Create a file called "terrakube.json" and include the terraform.tfvars

{
	"organization": "simple",
	"workspace": "workspace_demo",
	"workspaceSrc": "https://github.com/AzBuilder/terraform-sample-repository.git",
	"terraform": "1.2.9",
	"folder": "/workspace2"
}

Test Locally

This can be used to test the github action in your local machine.

git clone https://github.com/AzBuilder/terrakube-action-github.git
yarn install

After cloning the project update the file tests with the environment variales

yarn test

Support

If you’d like help with this github action, or you have an issue or feature request, let us know.

If you’re reporting an issue, please include:

  • the version of the github action
  • relevant logs and error messages
  • steps to reproduce