Skip to content

Commit

Permalink
🚚 move github acctions example to new dir
Browse files Browse the repository at this point in the history
💚 update github actions example module source
  • Loading branch information
colinwilson committed Apr 28, 2021
1 parent 9c5434a commit 7cd0048
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
needs: terraform-fmt
runs-on: ubuntu-latest
env:
WORKING_DIR: "examples/default_deployment"
WORKING_DIR: "examples/github_actions"
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
4 changes: 3 additions & 1 deletion examples/default_deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ This example illustrates how to use the `terraform-digitalocean-ha-k3s` module.

## Outputs

TBC
| Name | Description |
|------|-------------|
| cluster_summary | A summary of the cluster's provisioned resources. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
9 changes: 0 additions & 9 deletions examples/default_deployment/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
terraform {
# Reconfigure the backend block to suit your needs
backend "remote" {
hostname = "app.terraform.io"
organization = "AIGISUK"

workspaces {
name = "gh-actions-terraform-digitalocean-ha-k3s"
}
}
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
Expand Down
17 changes: 17 additions & 0 deletions examples/github_actions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# GitHub Actions Deployment Example

This example is specifically for module tests.

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| do_token | DigitalOcean Personal Access Token | string | N/A | yes |
| ssh_key_fingerprints | List of SSH Key fingerprints | list(string) | N/A | yes |

## Outputs

| Name | Description |
|------|-------------|
| cluster_summary | A summary of the cluster's provisioned resources. |
26 changes: 26 additions & 0 deletions examples/github_actions/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
terraform {
# Reconfigure the backend block to suit your needs
backend "remote" {
hostname = "app.terraform.io"
organization = "AIGISUK"

workspaces {
name = "gh-actions-terraform-digitalocean-ha-k3s"
}
}
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
}
required_version = ">= 0.13"
}

provider "digitalocean" {}

module "ha-k3s" {
source = "git::https://github.com/aigisuk/terraform-digitalocean-ha-k3s.git?ref=develop"

do_token = var.do_token
ssh_key_fingerprints = var.ssh_key_fingerprints
}
3 changes: 3 additions & 0 deletions examples/github_actions/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
output "cluster_summary" {
value = module.ha-k3s.cluster_summary
}
2 changes: 2 additions & 0 deletions examples/github_actions/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variable "ssh_key_fingerprints" {}
variable "do_token" {}

0 comments on commit 7cd0048

Please sign in to comment.